/* Case Studies Page */

/* Filter Section */
.filter-section {
    background: white;
    padding: 2rem 0;
    position: sticky;
    top: 80px;
    z-index: 50;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn i {
    font-size: 0.9rem;
}

.filter-btn:hover {
    background: #f8fafc;
    color: #2563eb;
}

.filter-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* Case Studies Grid */
.case-studies-section {
    padding: 4rem 0;
    background: #f8fafc;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.case-studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.case-study-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateY(0);
    cursor: pointer;
    display: block;
}

/* Page load animation class (optional) */
.case-study-card.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.case-study-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.case-study-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.case-image-container {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.case-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.case-study-card:hover .case-image {
    transform: scale(1.05);
}

.case-overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.case-content {
    padding: 1.5rem;
}

.case-metrics {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.metric-primary {
    flex: 1;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
}

.metric-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: #2563eb;
    line-height: 1;
}

.metric-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
}

.metric-secondary {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.metric-item {
    background: #f1f5f9;
    border-radius: 8px;
    padding: 0.5rem;
    text-align: center;
}

.metric-number {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.metric-text {
    font-size: 0.7rem;
    color: #64748b;
}

.case-info {
    margin-top: 1rem;
}

.case-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.case-description {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.case-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: #e0e7ff;
    color: #2563eb;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Case Study Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f1f5f9;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    font-size: 18px;
}

.modal-close:hover {
    background: #2563eb;
    color: white;
    transform: scale(1.1);
}

.modal-close:active {
    transform: scale(0.95);
}

.modal-header {
    padding: 2rem 2rem 1rem;
    position: relative;
    border-bottom: 1px solid #e2e8f0;
}

.modal-body .modal-platform {
    display: inline-block;
    background: #2563eb;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.modal-header h2 {
    font-size: 1.8rem;
    color: #1e293b;
    margin-bottom: 1rem;
    max-width: 80%;
    line-height: 1.3;
}

.modal-metrics {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.modal-metric {
    text-align: center;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    min-width: 100px;
}

.modal-metric .metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563eb;
    display: block;
}

.modal-metric .metric-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.modal-body {
    padding: 2rem;
}

.challenge-section, .solution-section, .results-section, .testimonial-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #f1f5f9;
}

.challenge-section:last-child, .solution-section:last-child, .results-section:last-child, .testimonial-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.challenge-section h3, .solution-section h3, .results-section h3 {
    font-size: 1.5rem;
    color: #1e293b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.challenge-section p, .solution-section p {
    color: #64748b;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.solution-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.step {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.step:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.step-number {
    background: #2563eb;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.step-content h4 {
    font-size: 1.1rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.step-content p {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.result-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
}

.result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.result-value {
    font-size: 2rem;
    font-weight: 800;
    color: #2563eb;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.result-label {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.result-change {
    font-size: 0.8rem;
    font-weight: 600;
    color: #10b981;
    background: #dcfce7;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    display: inline-block;
}

.testimonial-section blockquote {
    background: #f8fafc;
    border-left: 4px solid #2563eb;
    padding: 1.5rem;
    font-style: italic;
    color: #475569;
    line-height: 1.8;
    margin-bottom: 1rem;
    border-radius: 0 8px 8px 0;
    position: relative;
}

.testimonial-section blockquote::before {
    content: '"';
    font-size: 3rem;
    color: #2563eb;
    position: absolute;
    top: -0.5rem;
    left: 1rem;
    opacity: 0.3;
}

.testimonial-section cite {
    display: block;
    text-align: right;
    font-weight: 600;
    color: #1e293b;
    font-style: normal;
    margin-top: 1rem;
}

/* Animation keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Styles for Mobile (max-width: 768px) */
@media (max-width: 768px) {
    /* Filter Section */
    .filter-section {
        position: static; /* Non-fixed on mobile */
        background: white;
        padding: 2rem 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    }

    .filter-controls {
        gap: 0.5rem;
        padding: 0 1rem;
    }

    .filter-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    /* Case Studies Section */
    .container {
        padding: 0 1rem;
    }

    .case-studies-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        max-height: 95vh;
        margin: 1rem;
    }

    .modal-header {
        padding: 1.5rem 1.5rem 1rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-header h2 {
        font-size: 1.5rem;
        max-width: 100%;
    }

    .modal-platform {
        margin-bottom: 1rem;
        display: inline-block;
    }

    .solution-steps {
        grid-template-columns: 1fr;
    }

    .results-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

/* Smaller Mobile Devices (max-width: 480px) */
@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        border-radius: 12px;
        height: 85%
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-close {
        width: 36px;
        height: 36px;
        top: 0.75rem;
        right: 0.75rem;
    }

    .step {
        padding: 1rem;
    }

    .result-card {
        padding: 1rem;
    }

    .result-value {
        font-size: 1.5rem;
    }
}