/* Import better font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* CSS Variables */
:root {
    --primary: #8b5cf6;
    --secondary: #06b6d4;
    --accent: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0f172a;
    --dark-secondary: #1e293b;
    --dark-tertiary: #334155;
    --light: #f8fafc;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-muted: rgba(255, 255, 255, 0.65);
    --text-light: rgba(255, 255, 255, 0.75);
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.15);
}

/* Base Styles */
body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: var(--dark);
    scroll-behavior: smooth;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Typography Hierarchy - Professional Sizing */
.hero-title {
    font-size: 3.0rem;
    line-height: 1.4;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--primary);
    min-height: 2rem;
    transition: all 0.3s ease;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 800px;
    line-height: 1.7;
}

.hero-stat-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
}

.section-title {
    font-size: 2.5rem;
    line-height: 1.3;
}

.section-lead {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.6;
}

.section-description {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.section-content {
    max-width: 800px;
}

.category-title {
    font-size: 1.75rem;
}

.service-title {
    font-size: 1.125rem;
    color: var(--text-primary);
    font-weight: 600;
}

.service-description {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.project-title {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
}

.project-description {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.5;
}

.project-year {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tech-section-title {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.tech-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tech-category {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tech-proficiency {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.contact-method-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.contact-method-text {
    font-size: 0.9rem;
    color: var(--text-light);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.browser-url {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-accent {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-section {
    background: rgba(0,0,0,0.15);
}

/* Button Styles */
.btn-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.4);
    color: white;
}

.btn-outline-custom {
    border: 2px solid var(--glass-border);
    color: var(--text-secondary);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-custom:hover {
    background: var(--glass-bg);
    border-color: var(--primary);
    color: var(--text-primary);
}

.btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    color: #ffffff;
}

/* Navigation Styles */
.navbar {
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(20px);
    transition: background 0.4s ease;
    border-bottom: 1px solid var(--border-color);
}

.navbar.scrolled {
    background: rgba(15, 23, 42, 0.95) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.nav-link {
    color: var(--text-secondary) !important;
    transition: color 0.3s ease;
}

.nav-link.active {
    color: var(--text-primary) !important;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
}

.hero-badge {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
}

/* Project Cards */
.project-card-robust {
    background: var(--dark-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    transition: all 0.4s ease;
    overflow: hidden;
}

.project-card-robust:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(139, 92, 246, 0.5);
}

/* Gallery Styles - Removed Dynamic Island */
.gallery-container-robust {
    background: var(--dark-tertiary);
}

.gallery-display-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-frame-robust {
    background: #1a202c;
    border: 3px solid #4a5568;
    border-radius: 2rem;
    padding: 0.75rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.phone-screen-robust {
    background: var(--dark);
    border-radius: 1.8rem;
    overflow: hidden;
    width: 280px;
    height: 616px;
    position: relative;
    /* Removed dynamic island */
}

.browser-frame-robust {
    background: #2d3748;
    border-radius: 10px 10px 0 0;
    padding: 0.75rem;
}

.browser-dots { 
    display: flex; 
    gap: 0.4rem; 
}

.browser-dot { 
    width: 10px; 
    height: 10px; 
    border-radius: 50%; 
}

.browser-content-robust {
    background: var(--dark);
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    height: 380px;
}

.gallery-image-robust {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.gallery-image-robust.loading {
    opacity: 0.5;
    transform: scale(0.98);
}

.gallery-nav-robust {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 20;
}

.gallery-nav-robust:hover {
    background: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav-robust.prev { left: 1rem; }
.gallery-nav-robust.next { right: 1rem; }

/* Project Details & Badges */
.project-details-robust { 
    background: rgba(0, 0, 0, 0.2); 
}

.project-badge-robust { 
    background: var(--glass-bg); 
    padding: 0.4rem 0.8rem; 
    border-radius: 10px; 
    font-weight: 600; 
    font-size: 0.8rem; 
}

.project-badge-robust.status-live { 
    color: var(--accent); 
}

.project-badge-robust.status-completed { 
    color: var(--secondary); 
}

.project-badge-category-robust { 
    background: rgba(255, 255, 255, 0.1); 
    padding: 0.4rem 0.8rem; 
    border-radius: 10px; 
    font-size: 0.8rem; 
}

.stats-row-robust { 
    display: flex; 
    gap: 1rem; 
    flex-wrap: wrap; 
    padding: 1rem; 
    background: rgba(255, 255, 255, 0.05); 
    border-radius: 12px; 
}

.stat-item-robust { 
    flex: 1; 
    min-width: 80px; 
    text-align: center; 
}

.stat-value { 
    font-size: 1.1rem; 
    font-weight: 700; 
}

.badge-tech-robust { 
    background: rgba(139, 92, 246, 0.15); 
    border: 1px solid rgba(139, 92, 246, 0.2); 
    padding: 0.3rem 0.6rem; 
    border-radius: 6px; 
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Enhanced Modal Styles */
.modal-content {
    background: var(--dark);
    border: none;
    border-radius: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.modal-header-enhanced {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    flex-shrink: 0;
    z-index: 1056;
}

.modal-body-enhanced {
    flex-grow: 1;
    padding: 0;
    overflow: hidden;
}

.gallery-modal-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.gallery-image-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
}

.modal-gallery-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.gallery-thumbnails-section {
    flex-shrink: 0;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(15px);
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
}

.gallery-thumbnails {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0 2rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.gallery-thumbnail {
    width: 100px;
    height: 70px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    flex-shrink: 0;
    opacity: 0.7;
}

.gallery-thumbnail.active {
    border-color: var(--primary);
    transform: scale(1.1);
    opacity: 1;
}

.gallery-thumbnail:hover {
    opacity: 1;
    transform: scale(1.05);
}

.gallery-thumbnail img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.modal-nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    font-size: 1.5rem;
    z-index: 10;
    transition: all 0.3s ease;
}

.modal-nav-button:hover {
    background: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.modal-nav-button.prev { left: 2rem; }
.modal-nav-button.next { right: 2rem; }

/* Other Sections */
.service-card, .tech-card, .stat-card, .contact-card {
    background: var(--dark-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.4s ease;
    height: 100%;
}

.service-card:hover, .tech-card:hover, .stat-card:hover, .contact-card:hover {
    transform: translateY(-5px);
    background: var(--dark-tertiary);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.contact-card { 
    text-decoration: none; 
    color: inherit; 
}

.contact-card:hover { 
    color: inherit; 
}

.service-icon { 
    width: 50px; 
    height: 50px; 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.25rem; 
    color: white; 
}

.progress { 
    background: rgba(255, 255, 255, 0.1); 
    border-radius: 8px; 
    height: 8px; 
}

.progress-bar { 
    background: linear-gradient(135deg, var(--primary), var(--secondary)); 
    transition: width 1.5s ease; 
}

.stat-number { 
    font-size: 1.8rem; 
    font-weight: 800; 
    background: linear-gradient(135deg, var(--primary), var(--secondary)); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
}

/* Animations */
.fade-in, .slide-in-left, .slide-in-right { 
    opacity: 0; 
    transition: all 0.8s ease; 
}

.fade-in { 
    transform: translateY(30px); 
}

.slide-in-left { 
    transform: translateX(-40px); 
}

.slide-in-right { 
    transform: translateX(40px); 
}

.fade-in.visible, .slide-in-left.visible, .slide-in-right.visible { 
    opacity: 1; 
    transform: translateY(0) translateX(0); 
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .phone-screen-robust { 
        width: 252px; 
        height: 554px; 
    }
    
    .browser-content-robust { 
        height: 320px; 
    }
    
    .gallery-container-robust { 
        border-radius: 20px 20px 0 0; 
    }
    
    .project-details-robust { 
        border-radius: 0 0 20px 20px; 
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .modal-nav-button.prev { 
        left: 0.5rem; 
    }
    
    .modal-nav-button.next { 
        right: 0.5rem; 
    }
    
    .gallery-thumbnails { 
        padding: 0 0.5rem; 
    }
}

/* Accessibility */
.btn:focus, a:focus, button:focus {
    outline: 3px solid rgba(139, 92, 246, 0.6) !important;
    outline-offset: 2px;
    box-shadow: none !important;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Smooth transitions for all interactive elements */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
}
