/* ===================================
   Projects Page - Modern Design
   =================================== */

:root {
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-200: #bfdbfe;
    --blue-300: #93c5fd;
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --blue-800: #1e40af;
    --blue-900: #1e3a8a;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --white: #ffffff;
    --black: #000000;
    
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===================================
   Navigation
   =================================== */
/* Navigation styles are inherited from main.css */

/* Projects page specific adjustments */
.main-nav {
    background: rgba(255, 255, 255, 0.95);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--gray-900);
    transition: var(--transition);
}

/* ===================================
   Hero Section
   =================================== */

.projects-hero {
    background: linear-gradient(135deg, var(--blue-600) 0%, var(--blue-800) 100%);
    color: var(--white);
    padding: 8rem 0 4rem;
    margin-top: 70px;
    position: relative;
    overflow: hidden;
}

.projects-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    color: var(--white);
}

.hero-content * {
    color: inherit;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    color: var(--white);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    color: var(--white);
}

.hero-description {
    font-size: 1.25rem;
    color: var(--white);
    opacity: 0.95;
    line-height: 1.8;
}

/* ===================================
   Projects Grid
   =================================== */

.projects-main {
    padding: 4rem 0;
    min-height: 60vh;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    align-items: stretch;
}

.project-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--gray-200);
    height: 100%;
    max-width: 100%;
    min-height: 450px;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--blue-400);
}

.project-image-wrapper {
    position: relative;
    width: 100%;
    height: 240px !important;
    min-height: 240px;
    max-height: 240px;
    overflow: hidden;
    background: var(--gray-100);
    flex-shrink: 0;
}

.project-image {
    width: 100% !important;
    height: 100% !important;
    min-height: 240px;
    object-fit: cover !important;
    object-position: center;
    display: block;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .project-image {
    transform: scale(1.05);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(37, 99, 235, 0.9), transparent);
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.overlay-text {
    color: var(--white);
    font-weight: 600;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transform: translateY(10px);
    transition: var(--transition);
}

.project-card:hover .overlay-text {
    transform: translateY(0);
}

.project-content {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.project-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-description {
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 1.25rem;
    flex: 1;
    font-size: 0.9375rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

.view-details {
    background: var(--blue-600) !important;
    color: var(--white) !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.625rem 1.25rem !important;
    border-radius: 8px !important;
    transition: var(--transition) !important;
    border: none !important;
    cursor: pointer !important;
    font-family: var(--font-primary) !important;
    line-height: 1.5 !important;
    white-space: nowrap !important;
}

.view-details:hover {
    background: var(--blue-700) !important;
    color: var(--white) !important;
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}

.view-details:focus {
    outline: 2px solid var(--blue-500);
    outline-offset: 2px;
}

.view-details svg {
    transition: var(--transition);
    width: 14px;
    height: 14px;
}

.view-details:hover svg {
    transform: translateX(2px);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-500);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

/* Skeleton Loading */
.project-skeleton {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

.skeleton-image {
    width: 100%;
    height: 240px;
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.skeleton-content {
    padding: 2rem;
}

.skeleton-title {
    height: 24px;
    width: 70%;
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.skeleton-text {
    height: 16px;
    width: 100%;
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.skeleton-text.short {
    width: 60%;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===================================
   Modal
   =================================== */

.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-modal.active {
    display: flex;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-container {
    position: relative;
    background: var(--white);
    border-radius: var(--border-radius);
    max-width: 1200px;
    max-height: 90vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    z-index: 1;
}

.project-modal.active .modal-container {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    color: var(--gray-700);
}

.modal-close:hover {
    background: var(--white);
    transform: rotate(90deg);
}

.modal-content {
    display: grid;
    grid-template-columns: minmax(400px, 1fr) minmax(500px, 1.2fr);
    max-height: 90vh;
    overflow: hidden;
}

.modal-image-section {
    background: var(--gray-900);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    min-width: 400px;
    flex-shrink: 1;
}

.modal-carousel {
    position: relative;
    flex: 1;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-main {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.carousel-slide {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.carousel-slide.active {
    display: flex;
}

.carousel-slide img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
}

.carousel-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    pointer-events: none;
}

.carousel-btn {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray-700);
    pointer-events: all;
}

.carousel-btn:hover {
    background: var(--white);
    transform: scale(1.1);
}

.carousel-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.carousel-indicators {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    backdrop-filter: blur(10px);
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.carousel-indicator.active {
    background: var(--white);
    width: 24px;
    border-radius: 4px;
}

.modal-thumbs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    background: var(--gray-800);
}

.modal-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    background: var(--gray-700);
}

.modal-thumb:hover {
    border-color: var(--blue-400);
}

.modal-thumb.active {
    border-color: var(--blue-500);
}

.modal-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info-section {
    padding: 3rem;
    overflow-y: auto;
    max-height: 90vh;
    min-width: 500px;
    max-width: 700px;
    display: flex;
    flex-direction: column;
}

.modal-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.modal-description {
    color: var(--gray-600);
    line-height: 1.8;
    font-size: 1.0625rem;
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.modal-description p {
    margin-bottom: 1rem;
}

.modal-description a {
    color: var(--blue-600);
    text-decoration: none;
    font-weight: 500;
}

.modal-description a:hover {
    text-decoration: underline;
}

/* ===================================
   Footer
   =================================== */

.projects-footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 2rem 0;
    text-align: center;
}

/* ===================================
   Responsive
   =================================== */

@media (max-width: 968px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 1.5rem;
    }
    
    .project-image-wrapper {
        height: 220px !important;
        min-height: 220px;
        max-height: 220px;
    }
    
    .project-image {
        min-height: 220px !important;
    }
    
    .modal-content {
        grid-template-columns: 1fr;
        max-height: 95vh;
    }
    
    .modal-image-section {
        max-height: 50vh;
    }
    
    .modal-info-section {
        max-height: 45vh;
        padding: 2rem;
        min-width: 100%;
        max-width: 100%;
    }
    
    /* Navigation styles inherited from main.css */
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .projects-hero {
        padding: 6rem 0 3rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
        color: var(--white);
    }
    
    .hero-description {
        font-size: 1.125rem;
        color: var(--white);
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-image-wrapper {
        height: 200px !important;
        min-height: 200px;
        max-height: 200px;
    }
    
    .project-image {
        min-height: 200px !important;
    }
    
    .project-content {
        padding: 1.5rem;
    }
    
    .project-title {
        font-size: 1.25rem;
    }
    
    .projects-main {
        padding: 2rem 0;
    }
    
    .modal-container {
        max-height: 95vh;
        margin: 1rem;
    }
    
    .modal-info-section {
        padding: 1.5rem;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
}
