/* assets/style.css - Enhanced, Dream-themed, Responsive Styling */

/* Import Google Fonts for a modern, elegant look */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;700&family=Lora:ital,wght@0,400;0,700;1,400&display=swap');

/* CSS Variables for easy theme management */
:root {
    --primary-bg: rgba(0, 0, 0, 0.85);
    --primary-text: #f0e6d2;
    --secondary-text: #007BFF;
    --accent: #ffd700;
    --body-font: 'Montserrat', sans-serif;
    --header-font: 'Lora', serif;
    --container-bg: rgba(255, 255, 255, 0.97);
}

/* Global Settings */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--body-font);
    color: #333;
    background: url('/assets/dreamBackground.webp') center center fixed no-repeat !important;
    background-size: cover !important;
    line-height: 1.6;
}

/* Header */
header {
    background-color: var(--primary-bg);
    padding: 20px;
    text-align: center;
    position: relative;
}

.header-top {
    position: absolute;
    top: 5px;
    right: 20px;
    font-size: 0.8em;
    color: var(--secondary-text);
}

.header-top small {
    color: var(--secondary-text) !important;
}

.header-top a {
    color: var(--secondary-text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.header-top a:hover {
    text-decoration: underline;
}

header h1 {
    font-family: var(--header-font);
    font-size: 2.8em;
    color: var(--primary-text);
}

/* Navigation */
nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

nav ul li a {
    text-decoration: none;
    color: var(--primary-text);
    font-weight: 500;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: var(--accent);
}

/* Main Container */
main, .container {
    max-width: 1100px;
    margin: 30px auto;
    padding: 25px;
    background: var(--container-bg);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Dream Interpretation Container */
.dream-interpretation-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: var(--container-bg);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dream-interpretation-container h2 {
    font-family: var(--header-font);
    font-size: 2em;
    color: #1a1a2e;
    margin-bottom: 20px;
    text-align: center;
}

.dream-box {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.interpretation-box {
    background: #fff;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 1.1em;
    line-height: 1.6;
    color: #333;
}

/* Registration Notice */
.registration-notice {
    margin: 15px auto;
    max-width: 800px;
    padding: 10px;
    background-color: #e8f4fd;
    border: 1px solid #b3d7f2;
    border-radius: 4px;
    font-size: 0.95em;
    color: #333;
    text-align: center;
}

.registration-notice p {
    margin: 0;
}

/* Progress Overlay for indicating analysis in progress */
#progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-family: var(--header-font);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    font-size: 1.5em;
}

/* Toggle Switch Styling for share option */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-right: 8px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}
.toggle-switch input:checked + .slider {
    background-color: #1a1a2e;
}
.toggle-switch input:checked + .slider:before {
    transform: translateX(26px);
}
.update-button {
    font-size: 0.9em;
    padding: 2px 6px;
    margin-left: 10px;
}
.toggle-label {
    font-size: 0.9em;
    vertical-align: middle;
}

/* Headings and Paragraphs */
h2, h3 {
    margin-bottom: 15px;
    color: #1a1a2e;
}

p {
    font-size: 1.1em;
    margin-bottom: 15px;
}

/* Form Elements */
form textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #ccc;
    border-radius: 5px;
    font-size: 1.1em;
    resize: vertical;
}

form input[type="email"],
form input[type="password"],
form input[type="submit"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #ccc;
    border-radius: 5px;
    font-size: 1.1em;
}

form input[type="submit"] {
    background-color: #16213e;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}

form input[type="submit"]:hover {
    background-color: #1a1a2e;
    transform: scale(1.02);
}

/* Links */
a {
    color: #16213e;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--accent);
}

/* Call-to-Action Button */
.cta-button {
    display: inline-block;
    background-color: #16213e;
    color: #fff;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 5px;
    text-align: center;
    transition: background-color 0.3s, transform 0.3s;
}

.cta-button:hover {
    background-color: #1a1a2e;
    transform: scale(1.02);
}

/* Section Styling */
section {
    padding: 20px;
    margin-bottom: 30px;
    background: rgba(255,255,255,0.98);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Footer */
footer {
    background-color: var(--primary-bg);
    color: var(--primary-text);
    text-align: center;
    padding: 15px;
    font-size: 0.9em;
}

/* Subtle Fade-In Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

body, header, footer, main, section {
    animation: fadeIn 1.5s ease-in-out;
}

/* Dream Dictionary Styling */
.dream-dictionary {
    max-width: 900px;
    margin: 30px auto;
    padding: 20px;
    background: var(--container-bg);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.dream-dictionary h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #1a1a2e;
}
.dream-dictionary dl {
    margin: 20px 0;
}
.dream-dictionary dt {
    font-weight: bold;
    color: #16213e;
    margin-top: 15px;
    font-size: 1.1em;
}
.dream-dictionary dd {
    margin-left: 20px;
    margin-bottom: 10px;
    line-height: 1.5;
    font-size: 1em;
}

/* Responsive Styles */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    nav ul {
        flex-direction: column;
        gap: 10px;
    }
    main, .container {
        margin: 20px;
        padding: 20px;
    }
    h2 {
        font-size: 1.8em;
    }
    p, form textarea, form input[type="email"], form input[type="password"], form input[type="submit"] {
        font-size: 1em;
    }
    .cta-button {
        padding: 12px 24px;
        font-size: 1em;
    }
    /* Adjust Dream Dictionary Styles for Mobile */
    .dream-dictionary {
        max-width: 100%;
        margin: 20px auto;
        padding: 15px;
    }
    .dream-dictionary dt {
        font-size: 1em;
        margin-top: 10px;
    }
    .dream-dictionary dd {
        margin-left: 15px;
        font-size: 0.95em;
    }
}

@media (max-width: 480px) {
    header, footer {
        padding: 10px;
    }
    main, .container {
        margin: 10px;
        padding: 15px;
    }
    nav ul li a {
        font-size: 1em;
    }
    /* Further adjust Dream Dictionary Styles for smallest screens */
    .dream-dictionary {
        padding: 10px;
        margin: 10px;
    }
    .dream-dictionary dt {
        font-size: 0.9em;
        margin-top: 8px;
    }
    .dream-dictionary dd {
        margin-left: 10px;
        font-size: 0.85em;
    }
    /* Mobile Social Share: two per row */
    .social-share {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    .social-share a {
        flex: 1 1 calc(50% - 10px);
        margin: 5px;
        padding: 8px;
        text-align: center;
        font-size: 0.85em;
        box-sizing: border-box;
    }
}

/* ============================================================
   New Badge & Tooltip Styles
   ============================================================ */
.badge-container {
    position: relative;
    display: inline-block;
}
.badge-tooltip {
    visibility: hidden;
    background-color: var(--primary-bg);
    color: var(--primary-text);
    text-align: center;
    border-radius: 3px;
    padding: 4px 8px;
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
    font-size: 0.85em;
}
.badge-container:hover .badge-tooltip {
    visibility: visible;
    opacity: 1;
}
/* Default badge size for mobile */
.badge-container img {
    width: 50px;
    height: 50px;
}
.heart {
    color: red;
    font-family: 'Segoe UI Symbol', 'Symbola', sans-serif;
}

/* Increased badge size for wide screens */
@media (min-width: 768px) {
    .badge-container img {
        width: 70px;
        height: 70px;
    }
}

/* ============================================================
   New Social Share Button Styles
   ============================================================ */
.social-share {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
}
.social-share a {
    margin: 0 5px;
    padding: 8px 12px;
    background-color: var(--secondary-text);
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.3s;
    font-size: 0.9em;
}
.social-share a:hover {
    background-color: var(--accent);
    transform: scale(1.05);
}

/* ============================================================
   New Delete Button Styles (Force Red)
   ============================================================ */
.delete-button {
    font-size: 0.9em;
    padding: 2px 6px;
    margin-left: 5px;
    background-color: #e74c3c !important;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}
.delete-button:hover {
    background-color: #c0392b !important;
    transform: scale(1.02);
}

/*
 * Introductory text styling for the home page
 * The class `.intro-text` can be applied to a paragraph to center its content
 * and make any links within it more prominent.  Use this class on the
 * introduction paragraph that encourages visitors to explore other
 * sections (e.g. Dream Dictionary and Community pages).
 */
.intro-text {
    /* Center align the content across the full width of its container */
    text-align: center;
    font-size: 1.1em;
    margin: 20px 0;
    width: 100%;
}

/* Links inside the intro text should blend naturally */
.intro-text a {
    color: #16213e;       /* match the main body text colour */
    text-decoration: none;
    font-weight: 600;
}

/* On hover, use the accent colour to indicate interactivity without underlining */
.intro-text a:hover {
    color: var(--accent);
}

/*
 * Promotional links in the intro text
 * Use the `.promo-link` class on anchor tags that should be bold and use a
 * distinctive colour.  This styling overrides the general `.intro-text a` rules.
 */
.promo-link {
    /* Use a theme-friendly blue colour and bolder weight to highlight promotional links */
    color: #5C6BC0; /* soft indigo to complement the site's palette */
    font-weight: bold;
    text-decoration: none;
}

.promo-link:hover {
    color: var(--accent);
}

/*
 * Post-form section styling
 * This section appears below the dream submission form on the home page.  It
 * groups registration and cross-promotion messages together and centers
 * them on the page with appropriate spacing.
 */
.post-form-section {
    margin-top: 30px;
    text-align: center;
}

/* Ensure paragraphs inside the post-form section inherit center alignment */
.post-form-section p {
    text-align: center;
}

/*
 * Centered heading style
 * Apply this class to headings (e.g., h2) that should be centered on
 * specific pages, without affecting all headings globally.
 */
.center-heading {
    /* Center the heading and use a button-matching colour */
    text-align: center;
    color: #16213e;
}
