/* ===== CASE STUDY MODAL STYLES ===== */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    padding: 20px;
    overflow-y: auto;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.modal-container {
    background: white;
    max-width: 1000px;
    width: 100%;
    max-height: 95vh;
    border-radius: 20px;
    position: relative;
    transform: translateY(50px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-container {
    transform: translateY(0) scale(1);
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: rotate(90deg) scale(1.1);
}

.modal-close:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Modal Header */
.modal-header {
    position: relative;
    height: 300px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.modal-header-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.modal-header-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 40px 30px 30px;
    color: white;
}

.modal-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 15px;
   
}

.modal-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.modal-category-tag {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    opacity: 0.9;
}

.modal-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Modal Content */
.modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
}

.modal-description {
    font-size: 18px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 40px;
    text-align: justify;
}

/* Content Sections */
.modal-section {
    margin-bottom: 40px;
}

.modal-section-title {
    font-size: 24px;
    font-weight: 700;
    color: #222;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.modal-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #6610f2);
    border-radius: 2px;
}

.modal-section-content {
    font-size: 16px;
    line-height: 1.7;
    color: #555;
    text-align: justify;
}

/* Challenge & Solution Layout */
.challenge-solution-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.challenge-box,
.solution-box {
    padding: 30px;
    border-radius: 15px;
    border-left: 5px solid;
}

.challenge-box {
    background: #fff5f5;
    border-left-color: #e53e3e;
}

.solution-box {
    background: #f0fff4;
    border-left-color: #38a169;
}

.box-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.box-icon {
    font-size: 24px;
}

.challenge-box .box-icon {
    color: #e53e3e;
}

.solution-box .box-icon {
    color: #38a169;
}

.box-content {
    font-size: 15px;
    line-height: 1.6;
    color: #666;
}

/* Results Section */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.result-item {
    text-align: center;
    padding: 25px 20px;
    background: #f8f9fa;
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.result-item:hover {
    transform: translateY(-5px);
}

.result-number {
    font-size: 36px;
    font-weight: 900;
    color: #007bff;
    display: block;
    margin-bottom: 10px;
}

.result-label {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Technologies Used */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-align: center;
}

.tech-item:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.1);
}

.tech-icon {
    font-size: 32px;
    color: #007bff;
    margin-bottom: 10px;
}

.tech-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

/* Timeline */
.timeline {
    position: relative;
    margin: 30px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
    padding-left: 80px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 5px;
    width: 14px;
    height: 14px;
    background: #007bff;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #007bff;
}

.timeline-date {
    font-size: 12px;
    font-weight: 600;
    color: #007bff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.timeline-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.timeline-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* Modal Footer */
.modal-footer {
    padding: 30px 40px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.modal-btn-primary {
    background: #007bff;
    color: white;
}

.modal-btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.modal-btn-secondary {
    background: white;
    color: #6c757d;
    border: 2px solid #e9ecef;
}

.modal-btn-secondary:hover {
    border-color: #007bff;
    color: #007bff;
}

.modal-info {
    font-size: 12px;
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 10px;
    }
    
    .modal-container {
        max-height: 98vh;
        border-radius: 15px;
    }
    
    .modal-header {
        height: 200px;
    }
    
    .modal-title {
        font-size: 22px;
    }
    
    .modal-content {
        padding: 30px 25px;
    }
    
    .modal-section-title {
        font-size: 20px;
    }
    
    .challenge-solution-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .challenge-box,
    .solution-box {
        padding: 20px;
    }
    
    .results-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .tech-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .timeline-item {
        padding-left: 60px;
    }
    
    .modal-footer {
        padding: 20px 25px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .modal-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .modal-header {
        height: 150px;
    }
    
    .modal-title {
        font-size: 18px;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .modal-close {
        width: 35px;
        height: 35px;
        top: 15px;
        right: 15px;
        font-size: 16px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .result-number {
        font-size: 28px;
    }
}

/* Animation Classes */
.modal-fade-in {
    animation: modalFadeIn 0.4s ease;
}

.modal-fade-out {
    animation: modalFadeOut 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
}

/* Scrollbar Styling for Modal Content */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Accessibility */
.modal-overlay[aria-hidden="true"] {
    display: none;
}

.modal-container:focus {
    outline: none;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    padding-right: 17px; /* Compensate for scrollbar */
}

@media (max-width: 768px) {
    body.modal-open {
        padding-right: 0;
    }
}



/* ===== RESPONSIVE CASE STUDY MODAL STYLES ===== */

/* CSS Variables for original color theme */
:root {
    --modal-primary: #3b82f6;
    --modal-primary-dark: #2563eb;
    --modal-secondary: #8b5cf6;
    --modal-success: #10b981;
    --modal-danger: #ef4444;
    
    --modal-text: #333333;
    --modal-text-light: #64748b;
    --modal-text-muted: #94a3b8;
    --modal-background: #f8fafc;
    --modal-background-light: #f1f5f9;
    --modal-border: #e2e8f0;
    --modal-shadow: rgba(0, 0, 0, 0.25);
    
    --modal-transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --modal-border-radius: 16px;
    --modal-border-radius-small: 8px;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    padding: clamp(10px, 3vw, 20px);
    overflow-y: auto;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.modal-container {
    background: white;
    max-width: clamp(350px, 95vw, 1200px);
    width: 100%;
    max-height: clamp(400px, 95vh, 95vh);
    border-radius: var(--modal-border-radius);
    position: relative;
    transform: translateY(50px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    box-shadow: 0 25px 50px var(--modal-shadow);
    display: flex;
    flex-direction: column;
    margin: auto;
}

.modal-overlay.active .modal-container {
    transform: translateY(0) scale(1);
}

/* Close Button */
.modal-close {
    position: absolute;
    top: clamp(15px, 3vw, 20px);
    right: clamp(15px, 3vw, 20px);
    width: clamp(40px, 6vw, 50px);
    height: clamp(40px, 6vw, 50px);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    color: var(--modal-text);
    font-size: clamp(16px, 3vw, 20px);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--modal-transition);
}

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

.modal-close:focus {
    outline: 2px solid var(--modal-primary);
    outline-offset: 2px;
}

/* Modal Header */
.modal-header {
    position: relative;
    height: clamp(200px, 35vh, 400px);
    overflow: hidden;
    flex-shrink: 0;
}

.modal-header-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.modal-header-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: clamp(20px, 5vw, 40px);
    color: white;
}

.modal-title {
    font-size: clamp(20px, 5vw, 32px);
    font-weight: 800;
    color: var(--modal-text-dark);
    margin-bottom: clamp(15px, 3vw, 20px);
    line-height: 1.2;
}

.modal-categories {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(6px, 1.5vw, 8px);
    margin-bottom: clamp(15px, 3vw, 20px);
}

.modal-category {
    padding: clamp(4px, 1vw, 6px) clamp(8px, 2vw, 12px);
    background: var(--modal-background-light);
    color: var(--modal-text);
    border-radius: 20px;
    font-size: clamp(11px, 2vw, 14px);
    font-weight: 500;
}

.modal-date {
    color: var(--modal-text-muted);
    font-size: clamp(12px, 2.5vw, 14px);
}

/* Modal Content */
.modal-content {
    flex: 1;
    overflow-y: auto;
    padding: clamp(20px, 5vw, 40px);
}

.modal-description {
    font-size: clamp(16px, 3.5vw, 18px);
    line-height: 1.7;
    color: var(--modal-text-light);
    margin-bottom: clamp(25px, 5vw, 40px);
}

/* Content Sections */
.modal-sections {
    display: grid;
    gap: clamp(25px, 5vw, 40px);
}

.modal-section {
    border-left: 4px solid var(--modal-primary);
    padding-left: clamp(15px, 4vw, 24px);
}

.modal-section h3 {
    font-size: clamp(20px, 4vw, 24px);
    font-weight: 700;
    color: var(--modal-text);
    margin-bottom: clamp(12px, 3vw, 16px);
}

.modal-section p,
.modal-section li {
    font-size: clamp(14px, 3vw, 16px);
    line-height: 1.6;
    color: var(--modal-text-light);
}

.modal-section ul {
    list-style: none;
    padding: 0;
}

.modal-section li {
    padding: clamp(6px, 1.5vw, 8px) 0;
    position: relative;
    padding-left: clamp(18px, 4vw, 24px);
}

.modal-section li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--modal-success);
    font-weight: bold;
}

/* Modal Stats */
.modal-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: clamp(15px, 4vw, 24px);
    margin: clamp(20px, 5vw, 30px) 0;
}

.modal-stat {
    text-align: center;
    padding: clamp(15px, 4vw, 24px);
    background: var(--modal-background);
    border-radius: var(--modal-border-radius-small);
}

.modal-stat-number {
    font-size: clamp(24px, 6vw, 40px);
    font-weight: 800;
    color: var(--modal-primary);
    display: block;
    margin-bottom: clamp(6px, 1.5vw, 8px);
}

.modal-stat-label {
    font-size: clamp(11px, 2.5vw, 14px);
    color: var(--modal-text-muted);
    font-weight: 500;
}

/* Modal Footer */
.modal-footer {
    background: var(--modal-background);
    padding: clamp(20px, 5vw, 30px) clamp(25px, 6vw, 40px);
    border-top: 1px solid var(--modal-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: clamp(15px, 4vw, 20px);
}

.modal-footer-text {
    font-size: clamp(12px, 2.5vw, 14px);
    color: var(--modal-text-muted);
}

.modal-cta-btn {
    padding: clamp(10px, 2.5vw, 12px) clamp(18px, 4vw, 24px);
    background: linear-gradient(135deg, var(--modal-primary), var(--modal-secondary));
    color: white;
    text-decoration: none;
    border-radius: var(--modal-border-radius-small);
    font-weight: 600;
    font-size: clamp(12px, 2.5vw, 14px);
    display: inline-flex;
    align-items: center;
    gap: clamp(6px, 1.5vw, 8px);
    transition: var(--modal-transition);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    min-height: 44px; /* Touch target */
}

.modal-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.modal-cta-btn i {
    font-size: clamp(11px, 2vw, 14px);
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Large Tablets */
@media (max-width: 1024px) {
    .modal-container {
        max-width: 90vw;
    }
    
    .modal-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Standard Tablets */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 12px;
        align-items: flex-start;
        padding-top: 5vh;
    }
    
    .modal-container {
        max-height: 90vh;
        border-radius: 12px;
    }
    
    .modal-header {
        height: clamp(150px, 25vh, 250px);
    }
    
    .modal-content {
        padding: clamp(15px, 4vw, 24px);
    }
    
    .modal-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .modal-cta-btn {
        justify-content: center;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}

/* Large Mobile */
@media (max-width: 640px) {
    .modal-overlay {
        padding: 8px;
        padding-top: 3vh;
    }
    
    .modal-stats {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .modal-container {
        border-radius: 8px;
    }
    
    .modal-header {
        height: clamp(120px, 20vh, 200px);
    }
    
    .modal-content {
        padding: 16px;
    }
    
    .modal-stats {
        grid-template-columns: 1fr;
        max-width: 250px;
        margin: 20px auto 0;
    }
    
    .modal-footer {
        padding: 16px 20px;
    }
}

/* Extra Small Mobile */
@media (max-width: 360px) {
    .modal-overlay {
        padding: 5px;
        padding-top: 2vh;
    }
    
    .modal-content {
        padding: 12px;
    }
    
    .modal-footer {
        padding: 12px 16px;
    }
}

/* ===== ACCESSIBILITY & UX ===== */

/* Custom scrollbar */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--modal-background-light);
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--modal-border);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--modal-text-muted);
}

/* Accessibility */
.modal-overlay[aria-hidden="true"] {
    display: none;
}

.modal-container:focus {
    outline: none;
}

/* Focus management */
.modal-close:focus,
.modal-cta-btn:focus {
    outline: 2px solid var(--modal-primary);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .modal-container,
    .modal-close,
    .modal-cta-btn {
        transition: none;
    }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .modal-container {
        border: 2px solid var(--modal-text);
    }
    
    .modal-category {
        border: 1px solid var(--modal-text);
    }
    
    .modal-stat {
        border: 1px solid var(--modal-border);
    }
}

/* Print styles */
@media print {
    .modal-overlay {
        position: static;
        background: none;
        backdrop-filter: none;
    }
    
    .modal-container {
        box-shadow: none;
        max-height: none;
        overflow: visible;
    }
    
    .modal-close,
    .modal-footer {
        display: none;
    }
    
    .modal-content {
        overflow: visible;
    }
}
.nav .container{
    display: flex !important;
    align-items: center!important;
    justify-content: space-evenly !important;
    padding: 14px 24px !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
}