/* Case Studies Page Specific Styles */

/* Navbar logo management for case study pages */
.navbar .navbar-brand img {
    transition: all 0.3s ease;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure logo is always visible on case study pages */
.navbar .navbar-brand .navbar-logo {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    height: 80px !important;
    width: auto !important;
}

.case-studies-hero {
    background: linear-gradient(135deg, #181c2a 0%, #232946 100%);
    color: white;
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

.case-studies-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(24,28,42,0.85) 0%, rgba(35,41,70,0.92) 100%);
    opacity: 1;
    z-index: 1;
}

.case-studies-hero .container,
.case-studies-hero .row,
.case-studies-hero .col-lg-8 {
    position: relative;
    z-index: 2;
}

.case-study-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

/* Modal Styles */
.case-study-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    margin: 2% auto;
    padding: 0;
    border-radius: 20px;
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.4s ease;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 2rem 2rem;
    border-radius: 20px 20px 0 0;
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.modal-header-content {
    position: relative;
    z-index: 2;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.close-modal:hover {
    opacity: 1;
}

.modal-body {
    padding: 2rem;
}

.story-section {
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
    position: relative;
}

.story-section:nth-child(2) { animation-delay: 0.1s; }
.story-section:nth-child(3) { animation-delay: 0.2s; }
.story-section:nth-child(4) { animation-delay: 0.3s; }
.story-section:nth-child(5) { animation-delay: 0.4s; }

.story-section::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    opacity: 0.3;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.story-section h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    position: relative;
}

.story-section h3 i {
    color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 0.75rem;
    border-radius: 12px;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.story-section:hover h3 i {
    transform: scale(1.1);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
}

.story-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 2rem;
    border-radius: 16px;
    border-left: 4px solid #667eea;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.story-content::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.story-content:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.story-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: #444;
    font-size: 1.05rem;
    position: relative;
    z-index: 1;
}

.story-content p:last-child {
    margin-bottom: 0;
}

.story-content strong {
    color: #333;
    font-weight: 600;
}

.story-content .highlight {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
}

.media-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    margin-top: 3rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.media-section h4 {
    color: #333;
    font-weight: 700;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.media-placeholder {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #667eea;
    border-radius: 16px;
    padding: 4rem 2rem;
    color: #667eea;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.media-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-placeholder:hover::before {
    opacity: 1;
}

.media-placeholder i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
    position: relative;
    z-index: 1;
}

.media-placeholder p {
    position: relative;
    z-index: 1;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.media-placeholder small {
    position: relative;
    z-index: 1;
    opacity: 0.8;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.result-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-top: 4px solid #667eea;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.result-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
    display: block;
}

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

/* Progress Timeline */
.progress-timeline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0 3rem;
    position: relative;
    padding: 0 1rem;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.timeline-step::before {
    content: '';
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.timeline-step.active::before {
    background: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.4);
}

.timeline-step.completed::before {
    background: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.4);
}

.timeline-line {
    position: absolute;
    top: 30px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e9ecef;
    z-index: 1;
}

.timeline-progress {
    position: absolute;
    top: 30px;
    left: 0;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 1;
    transition: width 0.5s ease;
}

.timeline-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    text-align: center;
    margin-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timeline-step.active .timeline-label {
    color: #667eea;
}

.timeline-step.completed .timeline-label {
    color: #28a745;
}

/* Interactive Elements */
.interactive-highlight {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border-left: 3px solid #667eea;
    margin: 1rem 0;
    transition: all 0.3s ease;
}

.interactive-highlight:hover {
    transform: translateX(5px);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
}

.metric-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0.25rem;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    /* Ensure logo is always visible on mobile for case study pages */
    .navbar .navbar-brand img,
    .navbar .navbar-brand .navbar-logo {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        height: 80px !important;
        width: auto !important;
    }
    
    /* Prevent word hyphenation on mobile */
    body, h1, h2, h3, h4, h5, h6, p, span, div, a, li, td, th, label, button, input, textarea, select {
        -webkit-hyphens: none;
        -moz-hyphens: none;
        -ms-hyphens: none;
        hyphens: none;
        word-wrap: normal;
        overflow-wrap: normal;
    }
    
    /* Ensure titles and headings don't break */
    .case-studies-hero h1, .section-title, .case-study-content h4, .modal-header h4 {
        -webkit-hyphens: none;
        -moz-hyphens: none;
        -ms-hyphens: none;
        hyphens: none;
        word-wrap: normal;
        overflow-wrap: normal;
        white-space: normal;
    }
    
    /* Hero section mobile optimizations */
    .case-studies-hero {
        padding: 100px 0 60px;
        text-align: center;
    }
    
    .case-studies-hero h1 {
        font-size: 2.5rem;
        line-height: 1.2;
        margin-bottom: 1.5rem;
    }
    
    .case-studies-hero .lead {
        font-size: 1.1rem;
        line-height: 1.5;
        margin-bottom: 2rem;
    }
    
    /* Case study grid mobile layout */
    .case-study-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin: 2rem 0;
    }
    
    /* Case study cards mobile improvements */
    .case-study-card {
        margin-bottom: 1.5rem;
        border-radius: 16px;
        overflow: hidden;
    }
    
    .case-study-image {
        height: 200px;
    }
    
    .case-study-content {
        padding: 1.5rem;
    }
    
    .case-study-content h4 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    .case-study-content p {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }
    
    .case-study-stats {
        flex-direction: column;
        gap: 1rem;
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }
    
    .stat {
        padding: 1rem;
        background: rgba(102, 126, 234, 0.05);
        border-radius: 12px;
        border: 1px solid rgba(102, 126, 234, 0.1);
    }
    
    .stat-number {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
        font-weight: 600;
    }
    
    /* Modal mobile optimizations */
    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 1.5rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    /* Story section mobile improvements */
    .story-section {
        margin-bottom: 2rem;
    }
    
    .story-section::before {
        left: -1rem;
        width: 3px;
    }
    
    .story-section h3 {
        font-size: 1.3rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .story-section h3 i {
        padding: 0.5rem;
        font-size: 1rem;
    }
    
    .story-content {
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .story-content p {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    /* Media section mobile improvements */
    .media-section {
        padding: 2rem 1.5rem;
        margin-top: 2rem;
    }
    
    .media-section h4 {
        font-size: 1.3rem;
        margin-bottom: 1.5rem;
    }
    
    .media-placeholder {
        padding: 2rem 1rem;
    }
    
    .media-placeholder i {
        font-size: 3rem;
        margin-bottom: 1rem;
    }
    
    /* Results grid mobile layout */
    .results-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 2rem;
    }
    
    .result-card {
        padding: 1.5rem;
    }
    
    .result-number {
        font-size: 2rem;
    }
    
    .result-label {
        font-size: 1rem;
    }
    
    /* Progress timeline mobile layout */
    .progress-timeline {
        flex-direction: column;
        gap: 2rem;
        margin: 1.5rem 0 2rem;
    }
    
    .timeline-line {
        display: none;
    }
    
    .timeline-step {
        margin-bottom: 1rem;
    }
    
    .timeline-step::before {
        top: 15px;
    }
    
    .timeline-label {
        margin-top: 0.5rem;
        font-size: 0.75rem;
    }
    
    /* Interactive elements mobile improvements */
    .interactive-highlight {
        padding: 0.75rem 1rem;
        margin: 0.75rem 0;
    }
    
    .metric-badge {
        padding: 0.3rem 0.8rem;
        font-size: 0.75rem;
        margin: 0.2rem;
    }
}

@media (max-width: 576px) {
    /* Extra small mobile optimizations */
    .case-studies-hero {
        padding: 80px 0 50px;
    }
    
    .case-studies-hero h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .case-studies-hero .lead {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    /* Container adjustments */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Case study cards extra small mobile */
    .case-study-content {
        padding: 1.2rem;
    }
    
    .case-study-content h4 {
        font-size: 1.2rem;
    }
    
    .case-study-content p {
        font-size: 0.9rem;
    }
    
    .case-study-image {
        height: 180px;
    }
    
    /* Modal extra small mobile */
    .modal-content {
        width: 98%;
        margin: 2% auto;
    }
    
    .modal-header {
        padding: 1.2rem;
    }
    
    .modal-body {
        padding: 1.2rem;
    }
    
    /* Story section extra small mobile */
    .story-section h3 {
        font-size: 1.2rem;
    }
    
    .story-content {
        padding: 1.2rem;
    }
    
    .story-content p {
        font-size: 0.95rem;
    }
    
    /* Media section extra small mobile */
    .media-section {
        padding: 1.5rem 1rem;
    }
    
    .media-section h4 {
        font-size: 1.2rem;
    }
    
    .media-placeholder {
        padding: 1.5rem 1rem;
    }
    
    .media-placeholder i {
        font-size: 2.5rem;
    }
    
    /* Results grid extra small mobile */
    .result-card {
        padding: 1.2rem;
    }
    
    .result-number {
        font-size: 1.8rem;
    }
    
    .result-label {
        font-size: 0.9rem;
    }
    
    /* Interactive elements extra small mobile */
    .interactive-highlight {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .metric-badge {
        padding: 0.25rem 0.6rem;
        font-size: 0.7rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .case-study-card:hover,
    .result-card:hover,
    .story-content:hover,
    .interactive-highlight:hover {
        transform: none;
        box-shadow: none;
    }
    
    /* Add active states for touch feedback */
    .case-study-card:active,
    .result-card:active,
    .story-content:active,
    .interactive-highlight:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Improve touch targets */
    .case-study-card,
    .result-card,
    .interactive-highlight {
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
    }
    
    /* Remove tap highlight */
    * {
        -webkit-tap-highlight-color: transparent;
    }
}

/* Landscape mobile optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .case-studies-hero {
        padding: 80px 0 40px;
    }
    
    .case-studies-hero h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .case-studies-hero .lead {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .case-study-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .case-study-card {
        margin-bottom: 1rem;
    }
    
    .case-study-content {
        padding: 1rem;
    }
    
    .case-study-content h4 {
        font-size: 1.1rem;
    }
    
    .case-study-content p {
        font-size: 0.85rem;
    }
    
    .case-study-stats {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .stat {
        padding: 0.5rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
} 