/* ==========================================================================
   Case Studies Styles
   Reusable styles for all case study pages
   ========================================================================== */

/* Before/After Comparison Slider
   ========================================================================== */
.comparison-slider {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 12px;
    border: 2px solid rgba(30, 144, 255, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.comparison-slider * {
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.comparison-slider img {
    display: block;
    width: 100%;
    height: auto;
}

.comparison-before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: inset(0 50% 0 0);
}

.comparison-before img {
    width: 100%;
    height: auto;
}

.comparison-slider-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50px;
    height: 100%;
    transform: translateX(-50%);
    cursor: ew-resize;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comparison-slider-handle::before {
    content: '';
    position: absolute;
    width: 3px;
    height: 100%;
    background: var(--storm-electric);
    box-shadow: 0 0 20px var(--storm-electric);
}

.comparison-slider-button {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--storm-electric));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(30, 144, 255, 0.5);
    z-index: 11;
}

.comparison-slider-button svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.comparison-labels {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 5;
    pointer-events: none;
}

.comparison-label {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.comparison-label.before {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.comparison-label.after {
    background: rgba(34, 197, 94, 0.9);
    color: white;
}

/* Light/Dark Mode Toggle
   ========================================================================== */
.mode-toggle-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    max-width: 900px;
    margin: 0 auto 1rem;
}

.mode-toggle-link {
    color: var(--storm-electric);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mode-toggle-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.after-mode-toggle {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 20px;
    background: rgba(30, 144, 255, 0.1);
    border: 1px solid rgba(30, 144, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.after-mode-toggle:hover {
    background: rgba(30, 144, 255, 0.2);
    border-color: var(--storm-electric);
}

.after-mode-toggle svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.after-mode-toggle .sun-icon {
    color: #FCD34D;
}

.after-mode-toggle .moon-icon {
    color: #A5B4FC;
}

#afterImage {
    transition: opacity 0.3s ease;
}

/* Comparison Carousel Navigation
   ========================================================================== */
.comparison-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.comparison-nav-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(30, 144, 255, 0.1);
    border: 2px solid rgba(30, 144, 255, 0.3);
    color: var(--storm-electric);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.comparison-nav-btn:hover {
    background: rgba(30, 144, 255, 0.2);
    border-color: var(--storm-electric);
    transform: scale(1.1);
}

.comparison-nav-btn svg {
    width: 24px;
    height: 24px;
}

.comparison-title-wrapper {
    text-align: center;
    min-width: 200px;
}

.comparison-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

.comparison-counter {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Dots Indicator
   ========================================================================== */
.comparison-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.comparison-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(30, 144, 255, 0.2);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.comparison-dot.active {
    background: var(--storm-electric);
    box-shadow: 0 0 10px var(--storm-electric);
}

.comparison-dot:hover {
    background: rgba(30, 144, 255, 0.5);
}

/* Problem Cards
   ========================================================================== */
.problem-card {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.problem-card:hover {
    border-color: rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

.problem-icon {
    width: 48px;
    height: 48px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.problem-icon svg {
    width: 24px;
    height: 24px;
    stroke: #EF4444;
}

/* Solution Cards
   ========================================================================== */
.solution-card {
    background: rgba(30, 144, 255, 0.05);
    border: 1px solid rgba(30, 144, 255, 0.2);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.solution-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--storm-electric));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.solution-card:hover {
    border-color: rgba(30, 144, 255, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(30, 144, 255, 0.1);
}

.solution-card:hover::before {
    opacity: 1;
}

.solution-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(30, 144, 255, 0.2), rgba(0, 212, 255, 0.1));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.solution-icon svg {
    width: 32px;
    height: 32px;
    stroke: var(--storm-electric);
}

/* Results Grid
   ========================================================================== */
.result-item {
    text-align: center;
    padding: 2rem;
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.result-item:hover {
    border-color: rgba(34, 197, 94, 0.4);
    transform: scale(1.02);
}

.result-icon {
    width: 60px;
    height: 60px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.result-icon svg {
    width: 28px;
    height: 28px;
    stroke: #22C55E;
}

/* Tech Stack Pills
   ========================================================================== */
.tech-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(30, 144, 255, 0.1);
    border: 1px solid rgba(30, 144, 255, 0.2);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--storm-electric);
    transition: all 0.2s ease;
}

.tech-pill:hover {
    background: rgba(30, 144, 255, 0.2);
    border-color: rgba(30, 144, 255, 0.4);
    transform: translateY(-2px);
}

/* Timeline (for future use)
   ========================================================================== */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--storm-electric), rgba(30, 144, 255, 0.2));
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    background: var(--storm-electric);
    border-radius: 50%;
    transform: translateX(-5px);
    box-shadow: 0 0 20px var(--storm-electric);
}

/* Design Challenge Card
   ========================================================================== */
.design-challenge-card {
    background: rgba(30, 144, 255, 0.03);
    border: 1px solid rgba(30, 144, 255, 0.15);
}

/* Section Backgrounds (utility classes)
   ========================================================================== */
.case-study-section-dark {
    background: linear-gradient(180deg, rgba(5, 5, 5, 0.9) 0%, rgba(15, 15, 15, 0.95) 100%);
}

.case-study-section-gradient {
    background: linear-gradient(180deg, rgba(5, 5, 5, 0.9) 0%, rgba(15, 15, 15, 0.95) 50%, rgba(5, 5, 5, 0.9) 100%);
}
