/* Fonts and Colors */
@import url('https://fonts.googleapis.com/css2?family=Pacifico&family=Roboto:wght@400;500;700&display=swap');

:root {
    --main-bg: #ffffff; /* White background */
    --card-bg: #ffffff;
    --primary-color: #d9534f;
    --secondary-color: #5bc0de;
    --text-color: #333;
    --btn-bg: #007bff; /* Button Background */
    --btn-hover: #0056b3; /* Button Hover */
    --shadow-color: rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --brand-color: #333; /* Light theme default */

    /* New Variables for Header and Footer */
    --header-bg: #d9534f; /* Original Header Background Color */
    --footer-bg: #d9534f; /* Original Footer Background Color */

    /* ADD THESE FOR LIGHT MODE DELETE BUTTON */
    --btn-danger-bg: #dc3545;
    --btn-danger-hover: #c82333;
}

.dark-theme {
    --main-bg: #1e1e2f; /* Dark background color */
    --main-bg-image: none; /* Remove background image in dark mode */

    --card-bg: #2e2e3e; /* Dark card background */
    --primary-color: #9c27b0; /* Purple primary color */
    --secondary-color: #673ab7; /* Deep Purple secondary color */
    --text-color: #e0e0e0; /* Light text color */
    --btn-bg: #388e3c; /* Darker Success Button Background */
    --btn-hover: #2e7d32; /* Darker Success Button Hover */
    --btn-danger-bg: #d32f2f; /* Darker Danger Button Background */
    --btn-danger-hover: #c62828; /* Darker Danger Button Hover */
    --shadow-color: rgba(255, 255, 255, 0.1);
    --brand-color: #fff; /* Dark theme override */

    /* Dark Theme Header and Footer Colors */
    --header-bg: #9c27b0; /* Dark Theme Header Background Color */
    --footer-bg: #9c27b0; /* Dark Theme Footer Background Color */

}

/* Optional: Transition for smooth theme change */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

header,
.navbar,
footer,
.feature-card,
.btn,
.profile-section,
.password-section,
.opt-in-section,
.create-family-section,
.wishlist-section,
.existing-items {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Global Body Styles */
body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: var(--main-bg); /* White background */
   /* background-image: url('/assets/css/snow-background.jpg'); Snow background image */
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    background-size: cover;
    color: var(--text-color);
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background-color: var(--header-bg); /* Use --header-bg variable */
    color: white;
    padding: 20px;
    text-align: center;
    position: relative; /* For positioning elements like the theme toggle if needed */
}

/* Title */
.title {
    font-family: 'Pacifico', cursive;
    font-size: 2.5rem;
    margin: 0;
}

/* Navbar Layout */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: auto;
}

.navbar nav {
    display: flex;
    gap: 15px;
}

.navbar .btn {
    background: var(--secondary-color);
    color: white;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-size: 1rem;
    font-weight: bold;
    transition: background 0.3s ease;
}

.navbar .btn:hover {
    background: var(--btn-hover);
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex-grow: 1;  /* This ensures the content stretches to fill the screen height */
}

/* Welcome Section */
.welcome {
    text-align: center;
    margin-bottom: 40px;
}

.welcome h2 {
    font-size: 2rem;
    color: var(--primary-color);
    font-family: 'Pacifico', cursive;
}

/* Features Layout */
.features {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.feature-card {
    background: var(--card-bg);
    width: 300px;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0px 4px 8px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0px 8px 16px var(--shadow-color);
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.feature-card p {
    margin-bottom: 15px;
}

/* Button Styles */
.btn {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 16px;
    background-color: var(--btn-bg);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9em;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn:hover {
    background-color: var(--btn-hover);
    transform: scale(1.05);
}

/* Footer */
footer {
    text-align: center;
    background: var(--footer-bg); /* Use --footer-bg variable */
    color: white;
    padding: 10px 0;
}

.brand-heading {
  font-family: 'Pacifico', cursive;
  color: var(--brand-color);
}

/* Ensure responsiveness */
@media (max-width: 900px) {
    .features {
        grid-template-columns: repeat(2, 1fr); /* 2 cards per row */
    }
}

@media (max-width: 600px) {
    /* Mobile Layout */
    .navbar {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .container {
        margin: 0 15px;
        padding: 20px;
        height: auto;
        flex-grow: 1; /* Ensures content takes full available height */
    }

    footer {
        position: static;
        width: 100%;
    }

    .features {
        grid-template-columns: 1fr; /* 1 card per row for mobile */
        justify-content: center; /* Center content */
    }

    .feature-card {
        width: 100%; /* Full width for mobile */
        max-width: 350px;
        margin: 10px auto; /* Center the cards horizontally */
    }

    header {
        padding: 15px;
    }

    .title {
        font-size: 2rem;
    }

    .welcome {
        margin-bottom: 20px;
    }

    /* Ensure content is centered properly on mobile */
    .features {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    /* Adjust button sizes on small screens */
    .btn {
        font-size: 0.9em;
        padding: 8px;
    }

    .delete-btn {
        font-size: 0.9em;
        padding: 8px;
        width: 100%;
    }

    .form-group input, 
    .form-group textarea {
        font-size: 0.9em;
    }

    .wishlist-form {
        gap: 10px;
    }

    /* Optional: Adjust table font size */
    table th, table td {
        font-size: 14px;
    }
}

/* Optional: Styling for Flash Messages */
.message {
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: bold;
    text-align: center;
}

.success {
    background-color: #d4edda;
    color: #155724;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
}

.info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Theme Toggle Styles */
.theme-toggle {
    margin-top: 20px;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.theme-toggle input[type="checkbox"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
}

/* Custom styles for Manage Wishlists Page */
.existing-items table th {
    background-color: var(--primary-color);
    color: white;
}

.existing-items table tr:nth-child(even) {
    background-color: #f9f9f9; /* Consider using var(--card-bg-secondary) if defined */
}

.existing-items table tr:hover {
    background-color: #f1f1f1; /* Consider using var(--card-bg-hover) if defined */
}

.existing-items .delete-btn {
    background-color: var(--btn-danger-bg);
    color: white;
    padding: 8px 12px;
    font-size: 0.9em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: none;
}

.existing-items .delete-btn:hover {
    background-color: var(--btn-danger-hover);
}

/* === Added Styles Below === */

/* Global Delete Button Styling */
.delete-btn {
    background-color: var(--btn-danger-bg); /* Red */
    color: white;
    padding: 8px 12px;
    font-size: 0.9em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    border: none;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.delete-btn:hover {
    background-color: var(--btn-danger-hover); /* Darker Red on Hover */
    transform: scale(1.05); /* Slightly enlarge on hover */
}

/* Helper‑Elf Modal (add to /assets/css/styles.css) */
#elf-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right:0; bottom:0;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  z-index: 1001;
}
#elf-modal.show {
  display: flex;
}
#elf-modal .elf-container {
  width: 360px;
  height: 500px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  position: relative;
}
#elf-modal .elf-container button#close-elf {
  position: absolute;
  top: 8px; right: 8px;
  border: none; background: transparent;
  font-size: 1.2em; cursor: pointer;
}

/* === End of Added Styles === */
