/* Custom Utilities */
body {
    background-color: #050505;
    color: #ffffff;
    overflow-x: hidden;
    /* Hide default cursor to use custom one */
    cursor: none;
    font-family: 'Inter', sans-serif;
}

/* Enhanced Custom Cursor */
#custom-cursor {
    width: 10px;
    height: 10px;
    background: #3b82f6;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s ease-out, background 0.3s ease;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5), 0 0 20px rgba(59, 130, 246, 0.3);
}

#cursor-follower {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.05);
    backdrop-filter: blur(2px);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.15s ease-out, border-color 0.3s ease, width 0.3s ease, height 0.3s ease, background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#cursor-follower span {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s;
    text-transform: uppercase;
}

/* Hover states for cursor */
body.cursor-hover #custom-cursor {
    transform: scale(0.5);
    background: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

body.cursor-hover #cursor-follower {
    width: 70px;
    height: 70px;
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.8);
    backdrop-filter: blur(4px);
    transform: translate(-15px, -15px);
}

body.cursor-hover #cursor-follower span {
    opacity: 1;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* Reveal Animation */
.reveal-section {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-section.active {
    opacity: 1;
    transform: translateY(0);
}

/* Card Reflection */
.card-reflection {
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(255, 255, 255, 0.1) 0%,
            transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    position: absolute;
    inset: 0;
    z-index: 10;
}

.tilt-card:hover .card-reflection {
    opacity: 1;
}

/* Ensure all interactive elements trigger cursor none */
a,
button,
.tilt-card {
    cursor: none;
}

/* Typing Animation Cursor */
.typing-cursor {
    display: inline-block;
    color: #3b82f6;
    margin-left: 4px;
    animation: blink 1s step-end infinite;
    font-weight: 300;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Modern Loading Screen Styles */
#loading-screen {
    transition: opacity 0.8s ease, transform 0.8s ease;
}

#loading-screen.fade-out {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
}

.loader-content {
    text-align: center;
    position: relative;
}

/* Spinning Circles Animation */
.loader-spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.loader-spinner {
    width: 120px;
    height: 120px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: #3b82f6;
    border-right-color: #8b5cf6;
    border-radius: 50%;
    animation: spinRing 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.spinner-icon {
    width: 40px;
    height: 40px;
    color: #3b82f6;
    animation: iconPulse 2s ease-in-out infinite;
    position: relative;
    z-index: 10;
}

@keyframes spinRing {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) scale(1.1);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Animated Logo */
.loader-logo-wrapper {
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.loader-logo-new {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    display: inline-block;
}

.letter {
    display: inline-block;
    animation: letterFloat 1s ease-out forwards;
    opacity: 0;
    transform: translateY(30px) rotate(-10deg);
}

.letter.accent {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.letter.space {
    width: 0.5em;
}

@keyframes letterFloat {
    0% {
        opacity: 0;
        transform: translateY(30px) rotate(-10deg);
    }

    60% {
        transform: translateY(-5px) rotate(2deg);
    }

    100% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
}

/* Loading Text with Dots */
.loader-text-new {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-bottom: 2rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.loading-dots span {
    animation: dotBlink 1.4s infinite;
    opacity: 0;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotBlink {

    0%,
    20% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* Modern Progress Bar */
.loader-bar-new {
    width: 350px;
    height: 6px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 10px;
    overflow: visible;
    position: relative;
    margin: 0 auto 1rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.loader-progress-new {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #3b82f6);
    background-size: 200% 100%;
    border-radius: 10px;
    animation: loadingProgress 2.5s ease-in-out forwards, gradientShift 1.5s linear infinite;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6), 0 0 40px rgba(139, 92, 246, 0.4);
    position: relative;
}

.loader-glow {
    position: absolute;
    top: -2px;
    left: 0;
    width: 100%;
    height: 10px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    border-radius: 10px;
    animation: glowMove 2s ease-in-out infinite;
}

@keyframes loadingProgress {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

@keyframes glowMove {

    0%,
    100% {
        transform: translateX(-100%);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

/* Percentage Counter */
.loader-percentage {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: percentPulse 0.5s ease-in-out infinite alternate;
}

@keyframes percentPulse {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.05);
    }
}

/* Bento Grid Layout */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    grid-auto-rows: 200px;
}

@media (min-width: 768px) {
    .bento-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.bento-card {
    position: relative;
    background: linear-gradient(135deg, rgba(15, 15, 15, 0.9), rgba(10, 10, 10, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    padding: 2rem;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.bento-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.bento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.bento-card:hover::before {
    transform: translateX(100%);
}

/* Bento Card Sizes */
.bento-large {
    grid-column: span 2;
    grid-row: span 2;
}

.bento-wide {
    grid-column: span 2;
    grid-row: span 1;
}

.bento-tall {
    grid-column: span 1;
    grid-row: span 2;
}

.bento-medium {
    grid-column: span 1;
    grid-row: span 1;
}

.bento-small {
    grid-column: span 1;
    grid-row: span 1;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .bento-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: minmax(180px, auto);
    }
    
    .bento-large,
    .bento-wide,
    .bento-tall,
    .bento-medium,
    .bento-small {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .loader-spinner {
        width: 100px;
        height: 100px;
    }

    .spinner-icon {
        width: 32px;
        height: 32px;
    }

    .loader-logo-new {
        font-size: 2.5rem;
    }

    .loader-bar-new {
        width: 280px;
    }
    
    .bento-card {
        padding: 1.5rem;
    }
}
/* Categories Grid Layout */
.skills-categories-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* في الشاشات الكبيرة نجعلها 3 أعمدة */
@media (min-width: 1024px) {
    .skills-categories-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

.category-card {
    background: linear-gradient(145deg, rgba(15, 15, 15, 0.9), rgba(10, 10, 10, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s ease, border-color 0.4s ease;
    height: 100%;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

/* عنوان البطاقة */
.category-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
}

/* حاوية المهارات داخل البطاقة */
.skills-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* تصميم المهارة الفردية داخل القائمة */
.skill-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.3s;
}

.skill-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}
