/* ==================== SUCCESS STORIES STYLES ==================== */

:root {
    /* Warna dialiaskan ke palet resmi EPIC Academy (lihat style.css) supaya
       seluruh halaman punya identitas visual yang sama persis dengan homepage.
       "gold" kini dialiaskan ke aksen cyan-teal — sesuai
       konvensi di Home & Roadmap — sementara elemen informasi/badge dipindah
       ke keluarga teal (primary) supaya senada dengan kartu profil. */
    --primary-color: var(--primary-900);
    --secondary-color: var(--primary-600);
    --gold: var(--accent-500);
    --gold-tint: var(--primary-100);
    --blue: var(--primary-600);
    --blue-tint: var(--primary-100);
    --purple: #0A4E64;
    --light-bg: var(--cream);
}

/* ==================== HERO SECTION ==================== */

.stories-hero {
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(12,112,137,.35), transparent 60%),
        radial-gradient(700px 400px at 100% 100%, rgba(63,185,212,.18), transparent 55%),
        var(--brand-gradient);
    color: white;
    padding-bottom: 2.25rem;
    position: relative;
    overflow: hidden;
}

.stories-hero h1 {
    font-size: 2.1rem;
}

.stories-hero h1 em {
    color: var(--gold);
    font-style: italic;
}

/* ==================== STAT CARDS ==================== */

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    animation: slideInUp 0.5s ease-out;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

.stat-value {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* ==================== FILTERS SECTION ==================== */

.filters-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 1.25rem;
    color: #8FA6AE;
    font-size: 1.1rem;
}

.search-box input {
    width: 100%;
    padding: 0.875rem 1.25rem 0.875rem 2.75rem;
    border: 2px solid #DDE7EA;
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(12,100,125, 0.12);
}

.search-box input::placeholder {
    color: #8FA6AE;
}

/* ==================== FILTERS SECTION ==================== */

.filters-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filter-group h5 {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-btn {
    padding: 0.5rem 1.05rem;
    border: 2px solid #DDE7EA;
    background: white;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #4A6069;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: white;
    box-shadow: 0 4px 12px rgba(63,185,212, 0.3);
}

.filter-btn i {
    font-size: 1rem;
}

/* ==================== STORIES COUNT ==================== */

.stories-count {
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--gold);
}

.stories-count p {
    margin: 0;
    color: #4A6069;
    font-weight: 500;
}

/* ==================== STORIES GRID ==================== */

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.story-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: fadeInUp 0.5s ease-out;
}

.story-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    transform: translateY(-8px);
}

.story-card.hidden {
    display: none;
}

/* ==================== STORY CARD PHOTO ==================== */

.story-photo {
    width: 100%;
    height: 170px;
    background: linear-gradient(135deg, var(--primary-700), var(--primary-900));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.story-photo::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="2" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect fill="url(%23dots)" x="0" y="0" width="100" height="100"/></svg>');
}

.story-photo i {
    position: relative;
    z-index: 1;
}

/* ==================== STORY CARD CONTENT ==================== */

.story-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.story-header {
    margin-bottom: 0.85rem;
}

.story-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.story-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #6B818A;
}

.story-location i {
    color: var(--blue);
}

.story-program {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    background: var(--blue-tint);
    color: var(--primary-700);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    width: fit-content;
}

.story-text {
    color: #4A6069;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem 0;
    border-top: 1px solid #DDE7EA;
}

.stat {
    text-align: center;
}

.stat-label {
    font-size: 0.75rem;
    color: #6B818A;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-color);
}

.story-success {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--blue-tint);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--primary-700);
    font-weight: 600;
    margin-bottom: 1rem;
}

.story-success i {
    font-size: 1rem;
}

.story-rating {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    color: var(--gold);
    font-size: 0.9rem;
}

.story-action {
    padding-top: 1rem;
    border-top: 1px solid #DDE7EA;
}

.story-action .btn {
    width: 100%;
    padding: 0.55rem 0.9rem;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.story-action .btn-gold {
    background: var(--gold);
    color: white;
    border: none;
}

.story-action .btn-gold:hover {
    background: var(--accent-600);
    transform: translateY(-2px);
}

/* ==================== NO RESULTS ==================== */

.no-results {
    text-align: center;
    padding: 3.4rem 1.7rem;
}

.no-results i {
    font-size: 3.4rem;
    color: #DDE7EA;
    margin-bottom: 1rem;
}

.no-results h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.no-results p {
    color: #6B818A;
    margin-bottom: 1rem;
}

/* ==================== MODAL STYLES ==================== */

.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-100), rgba(12,100,125, 0.08));
    border-bottom: 2px solid #DDE7EA;
}

.modal-title {
    font-weight: 700;
    color: var(--primary-color);
}

.modal-body {
    padding: 1.7rem;
}

.modal-story-header {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.7rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #DDE7EA;
}

.modal-story-photo {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-700), var(--primary-900));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.1rem;
    color: white;
    flex-shrink: 0;
}

.modal-story-info {
    flex: 1;
}

.modal-story-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.modal-story-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.modal-detail-item {
    display: flex;
    flex-direction: column;
}

.modal-detail-item strong {
    color: #6B818A;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.modal-detail-item span {
    color: var(--primary-color);
    font-weight: 600;
}

.modal-section {
    margin-bottom: 2rem;
}

.modal-section h5 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-section h5 i {
    color: var(--primary-600);
}

.modal-section p {
    color: #4A6069;
    line-height: 1.8;
}

.score-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    background: #F1F6F8;
    padding: 1rem;
    border-radius: 8px;
}

.score-item {
    text-align: center;
}

.score-label {
    font-size: 0.85rem;
    color: #6B818A;
    margin-bottom: 0.5rem;
}

.score-before {
    color: #dc3545;
    font-size: 1.25rem;
    font-weight: 700;
}

.score-after {
    color: var(--primary-600);
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-achievement {
    background: linear-gradient(135deg, var(--primary-100), rgba(12,100,125, 0.08));
    padding: 1.25rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent-500);
}

.modal-achievement-text {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-achievement-icon {
    font-size: 1.7rem;
    color: var(--gold);
}

.modal-achievement-content {
    flex: 1;
}

.modal-achievement-content strong {
    display: block;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.modal-achievement-content span {
    color: #6B818A;
    font-size: 0.9rem;
}

/* ==================== ANIMATIONS ==================== */

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

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden {
    display: none !important;
}

/* ==================== RESPONSIVE DESIGN ==================== */

@media (max-width: 992px) {
    .stories-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .stories-hero h1 {
        font-size: 1.6rem;
    }
}

@media (max-width: 768px) {
    .stories-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .stories-hero h1 {
        font-size: 1.35rem;
    }

    .filter-buttons {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.45rem 0.9rem;
        font-size: 0.8rem;
    }

    .filter-btn i {
        display: none;
    }

    .stat-card {
        padding: 1.05rem;
    }

    .modal-story-header {
        flex-direction: column;
        text-align: center;
    }

    .modal-story-photo {
        width: 84px;
        height: 84px;
        margin: 0 auto;
    }

    .modal-story-details {
        grid-template-columns: 1fr;
    }

    .score-comparison {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .stories-grid {
        grid-template-columns: 1fr;
    }

    .stories-hero h1 {
        font-size: 1.15rem;
    }

    .search-box input {
        padding: 0.65rem 0.9rem 0.65rem 2.3rem;
        font-size: 0.85rem;
    }

    .filter-group h5 {
        font-size: 0.85rem;
    }

    .filter-btn {
        padding: 0.45rem 0.65rem;
        font-size: 0.75rem;
    }

    .story-card {
        margin-bottom: 0.5rem;
    }

    .story-content {
        padding: 0.9rem;
    }

    .story-name {
        font-size: 1rem;
    }

    .story-text {
        -webkit-line-clamp: 2;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .modal-story-name {
        font-size: 1.1rem;
    }

    .stat-card {
        padding: 0.9rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }
}
