/* Custom Styles & Responsive Rules */

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent-color: #3b82f6;
    --border-color: #e2e8f0;
    --card-bg: rgba(255, 255, 255, 0.8);
    --input-bg: #f8fafc;
    --placeholder-color: #94a3b8;
}

body.dark-mode {
    --bg-primary: #0f172a;
    --bg-secondary: #020617;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #1e293b;
    --card-bg: rgba(30, 41, 59, 0.8);
    --input-bg: #1e293b;
    --placeholder-color: #64748b;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 4. Responsive Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 3. Responsive Container */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* 8. Spacing */
.section-padding {
    padding: 4rem 1rem;
}

@media (min-width: 768px) {
    .section-padding {
        padding: 6rem 2rem;
    }
}

@layer components {
    .glass-card {
        background-color: var(--card-bg);
        backdrop-filter: blur(12px);
        border: 1px solid var(--border-color);
    }

    .nav-link {
        transition: all 0.25s ease;
        @apply text-sm font-medium hover:text-blue-500 uppercase tracking-widest relative;
        color: var(--text-primary);
    }

    .nav-link:hover {
        transform: translateY(-2px);
    }

    .nav-link:active {
        transform: translateY(0);
    }

    .nav-link.active {
        color: var(--accent-color) !important;
    }

    .nav-link.active::after {
        content: '';
        @apply absolute -bottom-1 left-0 w-full h-0.5 bg-blue-500 rounded-full;
    }

    .mobile-nav-link {
        transition: all 0.2s ease;
        @apply text-lg font-medium hover:text-blue-500;
        color: var(--text-primary);
    }

    .mobile-nav-link.active {
        color: var(--accent-color) !important;
        @apply font-bold;
    }

    .social-icon-btn {
        background-color: var(--bg-primary);
        border: 1px solid var(--border-color);
        color: var(--text-primary);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        @apply p-2 rounded-full shadow-sm;
    }

    .social-icon-btn:hover {
        background-color: var(--accent-color);
        color: white;
        border-color: var(--accent-color);
        transform: scale(1.1) rotate(5deg);
        box-shadow: 0 8px 15px rgba(59, 130, 246, 0.3);
    }

    .social-icon-btn svg {
        width: 1.25rem;
        height: 1.25rem;
        stroke-width: 2px;
    }

    .social-icon-btn:active {
        transform: scale(0.95);
    }

    .form-input {
        width: 100%;
        padding: 0.75rem 1rem;
        border-radius: 0.75rem;
        background-color: var(--input-bg);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
        transition: all 0.2s ease;
    }

    .form-input:focus {
        outline: none;
        border-color: var(--accent-color);
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    }

    .form-input::placeholder {
        color: var(--placeholder-color);
    }

    .footer-link {
        color: var(--text-secondary);
        @apply text-xs hover:text-blue-500 transition-colors uppercase tracking-widest font-bold;
    }
    
    .btn-primary, .btn-secondary, button[type="submit"], #theme-toggle, #theme-toggle-mobile, #menu-toggle, #scroll-to-top {
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .btn-primary:hover, button[type="submit"]:hover {
        transform: scale(1.03) translateY(-2px);
        box-shadow: 0 10px 20px -10px rgba(59, 130, 246, 0.5);
    }

    .btn-primary:active, button[type="submit"]:active {
        transform: scale(0.97);
    }

    .btn-secondary:hover {
        transform: translateY(-2px);
        background-color: var(--bg-secondary);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    }

    .btn-secondary:active {
        transform: scale(0.97);
    }

    #theme-toggle:hover, #theme-toggle-mobile:hover, #menu-toggle:hover {
        transform: rotate(15deg) scale(1.1);
        background-color: var(--bg-secondary);
    }

    #scroll-to-top:hover {
        transform: scale(1.1) translateY(-5px);
        box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
    }

    #scroll-to-top:active {
        transform: scale(0.9);
    }

    .btn-primary {
        @apply px-8 py-4 bg-blue-600 text-white rounded-full font-semibold hover:bg-blue-700 flex items-center justify-center gap-2 group;
    }
    
    .btn-secondary {
        border: 1px solid var(--border-color);
        color: var(--text-primary);
        @apply px-8 py-4 rounded-full font-semibold flex items-center justify-center gap-2;
    }

    .theme-icon-dark {
        display: block;
    }
    .theme-icon-light {
        display: none;
    }

    body.dark-mode .theme-icon-dark {
        display: none;
    }
    body.dark-mode .theme-icon-light {
        display: block;
    }
}

/* Section Backgrounds */
.bg-alt {
    background-color: var(--bg-secondary);
}

/* 5. Portfolio Grid & 2. Layout System */
.responsive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

/* 7. Media Queries & Breakpoints */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 4rem;
    }
}

@media (max-width: 768px) {
    .hero-content {
        text-align: center;
    }
    
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-padding {
        padding: 3rem 1rem;
    }
}

/* Animations */
.skill-bar {
    transition: width 1.5s cubic-bezier(0.17, 0.55, 0.55, 1);
}

.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease-out;
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease-out;
}

.active-reveal {
    opacity: 1;
    transform: translate(0, 0);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    @apply bg-slate-100 dark:bg-slate-900;
}

::-webkit-scrollbar-thumb {
    @apply bg-slate-300 dark:bg-slate-700 rounded-full;
}

::-webkit-scrollbar-thumb:hover {
    @apply bg-slate-400 dark:bg-slate-600;
}

/* Selection */
::selection {
    @apply bg-blue-500/30;
}
