/* ---
Design System & Variables
-------------------------------------------------- */
:root {
    --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    --color-primary: #0B7285;
    /* Teal */
    --color-accent: #FF6B6B;
    /* Warm Red */
    --color-secondary: #FFD166;
    /* Gold */
    --color-deep: #264653;
    /* Dark Blue-Green */

    --text-primary: #212529;
    --text-secondary: #495057;
    --text-light: #f8f9fa;

    --bg-soft: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #dee2e6;

    --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 8px 16px rgba(38, 70, 83, 0.1);
    --shadow-large: 0 15px 30px rgba(38, 70, 83, 0.15);

    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---
Global & Typography
-------------------------------------------------- */
body {
    font-family: var(--font-body);
    background-color: var(--bg-soft);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    line-height: 1.6;
}

/* --- Accessibility Helper --- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---
Header & Navigation
-------------------------------------------------- */
.header {
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 990;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-content nav {
    flex-grow: 1;
    text-align: right;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    box-shadow: 0 4px 12px rgba(11, 114, 133, 0.3);
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-deep);
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
    justify-content: flex-end;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-primary);
}

.nav-button {
    background-color: var(--bg-soft);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-button:hover {
    background-color: var(--color-primary);
    color: var(--text-light);
    border-color: var(--color-primary);
}

.main-content {
    flex: 1;
    padding: 40px 0;
}

/* ---
Hero & Main CTA
-------------------------------------------------- */
.hero-section {
    text-align: center;
    margin-bottom: 40px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--color-deep);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    margin-left: auto;
    max-width: 750px;
    margin-right: auto;
}

.download-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-medium);
    max-width: 700px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
}

.input-section {
    margin-bottom: 1.5rem;
}

.input-label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-deep);
    margin-bottom: 0.5rem;
    text-align: left;
}

.input-group {
    display: flex;
    align-items: center;
    background-color: var(--bg-soft);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    position: relative;
}

.input-group:focus-within {
    border-color: var(--color-primary);
    background: var(--bg-white);
    box-shadow: 0 0 0 4px rgba(11, 114, 133, 0.15);
}

.input-icon {
    position: absolute;
    left: 20px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    pointer-events: none;
}

.url-input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    /* Left padding for icon */
    border: none;
    font-size: 1rem;
    font-family: var(--font-body);
    transition: all 0.3s ease;
    background: var(--bg-soft);
    color: var(--text-primary);
}

.url-input:focus {
    outline: none;
}

.url-input::placeholder {
    color: #adb5bd;
}

.download-btn {
    flex-shrink: 0;
    padding: 14px 28px;
    margin: 4px;
    background: var(--color-primary);
    color: var(--text-light);
    border: none;
    border-radius: 10px;
    /* Slightly smaller radius for inner button */
    font-size: 1rem;
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.download-btn:hover {
    background: #086174;
    /* Darker primary */
    box-shadow: 0 6px 20px rgba(11, 114, 133, 0.25);
    transform: translateY(-2px);
}

.alert-box {
    background-color: #fff3f3;
    color: #d90429;
    padding: 15px 20px;
    border: 1px solid #ffb3c1;
    border-radius: var(--border-radius);
    margin: 0 auto 30px auto;
    max-width: 600px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    font-weight: 500;
}

/* --- Favorite Profiles Section --- */
.favorite-profiles-section {
    max-width: 600px;
    margin: -20px auto 40px auto;
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--border-radius);
    padding: 20px;
    backdrop-filter: blur(5px);
}

.favorite-profiles-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.favorite-profiles-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
    text-align: center;
}

.clear-fav-btn {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.clear-fav-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.favorite-profiles-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.favorite-profile-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.favorite-profile-item:hover {
    transform: scale(1.05);
}

.favorite-profile-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.favorite-profile-item span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-text {
    transition: opacity 0.3s ease;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
}

.download-btn.loading .btn-text {
    opacity: 0;
}

.download-btn.loading .loading-spinner {
    opacity: 1;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ---
Results Section
-------------------------------------------------- */
.results-section {
    margin-top: 60px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    max-width: 1200px;
    padding: 20px;
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-color);
}

.profile-info-container {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
        "avatar header"
        "avatar stats"
        "bio bio";
    align-items: center;
    gap: 15px 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 20px;
}

.profile-info-avatar {
    grid-area: avatar;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 4px solid var(--bg-white);
    box-shadow: var(--shadow-soft);
}

.profile-info-details {
    grid-area: header;
    align-self: end;
}

.profile-info-header {
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400;
}

.profile-info-header strong {
    font-weight: 600;
}

.favorite-profile-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: transform 0.2s ease;
}

.favorite-profile-btn:hover {
    transform: scale(1.2);
}

.profile-info-bio {
    grid-area: bio;
    margin: 8px 0;
    color: var(--text-secondary);
}

.profile-info-stats {
    display: flex;
    gap: 25px;
    margin-top: 10px;
    grid-area: stats;
    color: #333;
}


.results-section.show {
    opacity: 1;
    transform: translateY(0);
}

.results-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.story-item {
    background: var(--bg-white);
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: grid;
    grid-template-rows: auto 1fr;
}

.story-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.story-preview {
    width: 100%;
    aspect-ratio: 9 / 14;
    background-color: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--border-color);
    font-size: 40px;
    position: relative;
    overflow: hidden;
}

.story-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.video-thumbnail {
    position: relative;
    cursor: pointer;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-button-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background-color 0.2s ease;
    pointer-events: none;
    /* Allows clicks to pass through to the parent */
}

.play-button-overlay::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 14px 0 14px 22px;
    border-color: transparent transparent transparent white;
    margin-left: 5px;
}

.story-preview img,
.story-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* This makes the image cover the area without distortion */
}

.story-type {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.story-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.story-overlay-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0px 15px;
    color: white;
}


.story-date {
    font-size: 14px;
    color: #fff;
    margin-bottom: 15px;
}

.story-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    max-height: 63px;
    /* Approx 3 lines */
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 10px;
}

.story-stats {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
}

.story-description a.mention-link {
    color: var(--color-secondary);
    font-weight: 600;
    text-decoration: none;
}

.story-description a.mention-link:hover {
    text-decoration: underline;
}

.download-story-btn {
    width: 100%;
    padding: 10px;
    background: var(--color-deep);
    color: var(--text-light);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-decoration: none;
    text-align: center;
    display: block;
}

.download-story-btn:hover {
    background: #34495e;
}

.features-section {
    margin-top: 80px;
}

.features-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--color-deep);
    margin-bottom: 50px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: #fff;
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--color-deep);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 24px;
    color: white;
}

.feature-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

/* --- New Highlights Rail Styles --- */
.highlights-rail-container {
    display: flex;
    overflow-x: auto;
    justify-content: center;
    gap: 25px;
    padding: 10px 5px 20px 5px;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.highlights-rail-container::-webkit-scrollbar {
    height: 8px;
}

.highlights-rail-container::-webkit-scrollbar-track {
    display: none;
}

.highlight-cover-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex-shrink: 0;
    width: 80px;
    text-align: center;
}

.highlight-cover-item img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    transition: border-color 0.3s ease, border-width 0.3s ease;
}

.highlight-cover-item.active img {
    border-color: var(--color-primary);
    border-width: 3px;
}



/* --- Back to Top Button --- */
#backToTopBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    border: none;
    outline: none;
    background-color: var(--color-deep);
    color: white;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    line-height: 50px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
    opacity: 0;
    transform: translateY(20px);
    visibility: hidden;
}

#backToTopBtn.show {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.feature-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer {
    background: var(--color-deep);
    color: #ced4da;
    text-align: center;
    padding: 40px 0;
    margin-top: 60px;
}

.disclaimer {
    background: #fff9db;
    border: 1px solid var(--color-secondary);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 30px;
    color: #6d591d;
}

.disclaimer-title {
    font-weight: 600;
    margin-bottom: 10px;
}

/* --- Tab Content --- */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* --- Content & FAQ Section --- */
.content-section {
    padding: 40px 0;
}

.content-card {
    background: var(--bg-white);
    border-radius: 16px;
    /* Slightly larger radius for the main card */
    padding: clamp(1.5rem, 5vw, 3rem);
    /* Responsive padding */
    box-shadow: var(--shadow-medium);
    color: var(--text-primary);
}

.content-card h2 {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--color-deep);
    margin-top: 1.5em;
    margin-bottom: 1em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid var(--color-primary);
}


.content-card h2:first-of-type {
    margin-top: 0;
}

.content-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-top: 1.5em;
    margin-bottom: 0.8em;
}

.content-card p,
.content-card li {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1em;
}

.content-card ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1.5em;
}

/* --- Tools Section --- */
.content-card ol {
    list-style: none;
    counter-reset: steps-counter;
    padding-left: 0;
    margin-bottom: 2em;
}

.content-card ol li {
    counter-increment: steps-counter;
    position: relative;
    padding-left: 50px;
    margin-bottom: 1.5em;
}

.content-card ol li::before {
    content: counter(steps-counter);
    position: absolute;
    left: 0;
    top: -5px;
    width: 36px;
    height: 36px;
    background-color: var(--color-secondary);
    color: var(--color-deep);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-heading);
    font-size: 1.1rem;
}

.content-card ul[aria-label="Key Features"] {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.content-card ul[aria-label="Key Features"] li {
    background-color: var(--bg-soft);
    padding: 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--color-accent);
    margin-bottom: 0;
}

.content-card ul[aria-label="Key Features"] li::before {
    display: none;
    /* Hide default checkmark for this specific list */
}

.tools-section {
    margin-top: 40px;
    margin-bottom: 30px;
}

.tools-grid {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 10px 5px;
    max-width: 100%;
    margin: 0 auto;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.tools-grid::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, and Opera */
}

.tool-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 15px;
    text-decoration: none;
    color: #333;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-medium);
}

.tool-icon {
    font-size: 1.5rem;
    color: white;
    background-image: linear-gradient(45deg, #833ab4, #fd1d1d);
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tool-name {
    font-weight: 600;
    font-size: 1rem;
}

/* --- Tab Navigation --- */
.tab-nav {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active,
.tab-btn:hover {
    color: #2c3e50;
    border-image: linear-gradient(to right, #833ab4, #fd1d1d) 1;
    border-bottom-width: 3px;
}

.content-card ul li {
    position: relative;
    padding-left: 25px;
    list-style: none;
}

.content-card ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #fd1d1d;
    font-weight: bold;
}

.content-card ol li {
    margin-bottom: 1em;
}

.content-card strong {
    color: #333;
}

/* FAQ Accordion Styles */
.faq-container {
    margin-top: 2em;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    width: 100%;
    padding: 20px 0;
    text-align: left;
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    position: relative;
    padding-right: 30px;
}

.faq-question::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--color-primary);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
    transform: translateY(-50%) rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
}

.faq-answer p {
    padding-bottom: 20px;
    margin-bottom: 0;
}

.faq-item.active .faq-answer {
    max-height: 300px;
    /* Adjust if answers are very long */
}

/* --- Story Modal --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(38, 70, 83, 0.85);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background-color: var(--color-deep);
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #4a6b78;
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    color: white;
}

.modal-close-btn {
    color: #ced4da;
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close-btn:hover,
.modal-close-btn:focus {
    color: white;
}

.story-viewer {
    width: 100%;
    height: 70vh;
    max-height: 800px;
    background: #000;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.story-viewer img,
.story-viewer video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modal-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-nav button,
.modal-nav a {
    background: #344e5a;
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

@media (max-width: 500px) {
    .container {
        padding: 0 5px;
    }

    .content-card {
        padding: 10px;
    }

    .results-section {
        padding: 5px;
    }

    .profile-info-header {
        gap: 5px;
    }

    .profile-info-container {
        grid-template-columns: 1fr;
        grid-template-areas:
            "avatar"
            "header"
            "stats"
            "bio";
        text-align: center;
        gap: 15px;
    }

    .profile-info-avatar {
        margin: 0 auto;
    }

    .profile-info-header {
        justify-content: center;
        font-size: 1.3rem;
    }

    .profile-info-stats {
        justify-content: center;
        gap: 20px;
        margin-top: 0;
    }
}

@media (max-width: 360px) {
    .hero-title {
        font-size: 2rem;
    }

    .profile-info-header {
        font-size: 1.2rem;
        /* Adjust header font for very small screens */
    }

    .profile-info-stats {
        flex-wrap: wrap;
        /* Allow stats to wrap if needed */
        gap: 15px;
    }

    .profile-info-bio {
        margin-top: 0;
        /* Reduce space above bio */
    }

    .tab-btn {
        padding: 10px 12px;
        font-size: 14px;
    }

    .profile-info-stats span {
        font-size: 0.9rem;
    }
}

/* Mobile Menu Toggle Button Styles */
.mobile-menu-toggle {
    display: none;
    /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    position: relative;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.mobile-menu-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.hamburger-bar {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #264653;
    /* Use explicit dark color */
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    border-radius: 2px;
}

.mobile-menu-toggle.open .hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.open .hamburger-bar:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.mobile-menu-toggle.open .hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
    .hero-title {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }

    .download-card {
        padding: 30px 20px;
    }

    .results-section {
        padding: 20px;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        padding: 0;
        gap: 0;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
        text-align: center;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        /* Always flex but hidden via height/opacity */
        border-top: 1px solid var(--border-color);
        z-index: 1000;
    }

    .nav-links.active {
        max-height: 400px;
        opacity: 1;
        padding: 20px 0;
    }

    .nav-links li {
        padding: 15px 0;
    }

    .mobile-menu-toggle {
        display: block !important;
    }

    .header-content {
        position: relative;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .tools-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        max-width: 900px;
        overflow-x: hidden;
    }
}