/* ==========================================================================
   1. Global Variables
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
    --bg-overlay: rgba(8, 2, 4, 0.82);
    --bg-popup: rgba(8, 2, 4, 0.95);
    --bg-btn: rgba(139, 26, 47, 0.25);
    --bg-btn-hover: rgba(139, 26, 47, 0.5);

    --text-light: #f0e8e8;
    --text-liked: #8B1A2F;

    --border-light: 1px solid rgba(139, 26, 47, 0.4);
    --border-btn: 1px solid rgba(139, 26, 47, 0.6);

    --radius-container: 15px;
    --radius-btn: 5px;
}

/* ==========================================================================
   2. Main Layout Components
   ========================================================================== */

#permanent-overlay {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 900px;
    background-color: var(--bg-overlay);
    border: var(--border-light);
    border-radius: var(--radius-container);
    color: var(--text-light);
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    z-index: 20;
}

#help-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 600px;
    background-color: var(--bg-popup);
    border: var(--border-light);
    border-radius: var(--radius-container);
    color: var(--text-light);
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    padding: 30px;
    text-align: center;
    z-index: 30;
}

/* ==========================================================================
   3. Component Sections & Containers
   ========================================================================== */

.overlay-section {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
    border-right: var(--border-light);
    text-align: center;
}

.overlay-section:last-child {
    border-right: none;
}

.overlay-section p {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.nav-buttons,
.action-buttons,
.language-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
}

.action-buttons,
.language-buttons {
    gap: 10px;
}

.action-buttons {
    margin-top: 10px;
}

.language-buttons {
    margin-bottom: 20px;
}

.help-content {
    margin: 20px 0;
    line-height: 1.6;
}

/* ==========================================================================
   4. Buttons
   ========================================================================== */

/* Shared styles for all standard buttons */
.nav-button,
.help-button,
.lang-button,
.close-button,
.action-button {
    background-color: var(--bg-btn);
    border: var(--border-btn);
    border-radius: var(--radius-btn);
    color: var(--text-light);
    cursor: pointer;
    text-align: center;
}

/* Shared hover/active state */
.nav-button:hover,
.help-button:hover,
.close-button:hover,
.action-button:hover,
.lang-button.active {
    background-color: var(--bg-btn-hover);
}

/* Individual button tweaks */
.nav-button {
    padding: 5px 10px;
    margin: 0 5px;
    font-size: 18px;
}

.help-button,
.lang-button,
.action-button {
    padding: 8px 15px;
}

.close-button {
    padding: 8px 20px;
    margin-top: 20px;
}

/* Special button styles (icon-style) */
.like-button {
    color: var(--text-light);
}

.like-button.liked {
    color: var(--text-liked);
}

/* ==========================================================================
   5. Content Toggling
   ========================================================================== */

.help-image {
    max-width: 150px; /* Adjust as needed */
    height: auto;
    display: inline-block; /* Change to inline-block to allow images to sit next to text */
    vertical-align: middle;
    margin: 0 5px; /* Adjust margin for better spacing */
}

.desktop-image {
    display: block;
}


.help-text {
    display: none;
}

.help-text.active {
    display: block;
}

/* ==========================================================================
   6. Media Queries (Mobile First approach would be better, but preserving structure)
   ========================================================================== */

@media screen and (max-width: 600px) {
    #permanent-overlay {
        width: 100%;
        bottom: 10px;
        padding: 8px;
        border-radius: 0;
    }

    .overlay-section {
        padding: 0 4px;
    }

    .overlay-section p {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .action-button {
        min-height: 60px;
        gap: 4px;
    }

    .nav-button,
    .help-button,
    .action-button {
        font-size: 16px;
    }

    .help-image {
        max-width: 50px; /* Adjust as needed */
    }

    #help-popup {
        width: 90%;
        padding: 20px;
        max-height: 80vh;
    }
}

/* ==========================================================================
   7. Share Modal
   ========================================================================== */

#share-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(4, 1, 2, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
}

#share-modal.open {
    display: flex;
}

#share-card {
    background: rgba(14, 3, 6, 0.97);
    border: 1px solid rgba(139, 26, 47, 0.4);
    border-radius: 16px;
    padding: 2rem 2rem 1.6rem;
    width: min(340px, 88vw);
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    color: #f0e8e8;
}

#share-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.4rem;
}

#share-title {
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: #f0e8e8;
}

#share-close {
    background: none;
    border: none;
    color: #9a7070;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.2s;
}

#share-close:hover {
    color: #f0e8e8;
}

#share-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.share-opt-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.65rem 1rem;
    background: rgba(139, 26, 47, 0.1);
    border: 1px solid rgba(139, 26, 47, 0.3);
    border-radius: 8px;
    color: #f0e8e8;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    text-align: left;
}

.share-opt-btn:hover {
    background: rgba(139, 26, 47, 0.3);
    border-color: rgba(139, 26, 47, 0.7);
}

.share-icon {
    font-style: normal;
    font-size: 1rem;
    min-width: 1.2rem;
    text-align: center;
}

#copy-confirm {
    margin: 0.9rem 0 0;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    color: #8B1A2F;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#copy-confirm.visible {
    opacity: 1;
}

.share-button {
    font-size: 1.1rem;
}