/* ===== CSS Variables - Cozy Christmas Theme ===== */
:root {
    --primary-red: #c41e3a;
    --dark-red: #8b0000;
    --cream: #faf3e0;
    --warm-white: #fff8f0;
    --forest-green: #2d5a27;
    --gold: #d4af37;
    --soft-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    --text-dark: #2c2c2c;
    --text-muted: #666;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--cream) 0%, var(--warm-white) 100%);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
}

/* ===== Header ===== */
header {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--dark-red) 100%);
    color: white;
    padding: 1.5rem 2rem;
    text-align: center;
    box-shadow: var(--soft-shadow);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '❄️';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    opacity: 0.8;
}

header::after {
    content: '❄️';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    opacity: 0.8;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
}

header nav {
    margin-top: 1rem;
}

header nav a {
    color: white;
    text-decoration: none;
    margin: 0 1rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: var(--transition);
}

header nav a:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== Main Content ===== */
main {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
}

/* ===== Cards/Sections ===== */
section, .card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

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

/* ===== Typography ===== */
h1, h2, h3 {
    color: var(--primary-red);
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.75rem;
    border-bottom: 3px solid var(--gold);
    padding-bottom: 0.5rem;
    display: inline-block;
}

h3 {
    font-size: 1.25rem;
    color: var(--forest-green);
}

p {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

/* ===== Links ===== */
a {
    color: var(--primary-red);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--dark-red);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.back-link:hover {
    color: var(--primary-red);
}

/* ===== Buttons ===== */
button, .btn {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--dark-red) 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--soft-shadow);
    text-decoration: none;
    display: inline-block;
}

button:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.4);
}

button:active, .btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--forest-green) 0%, #1e3d1a 100%);
}

.btn-secondary:hover {
    box-shadow: 0 6px 20px rgba(45, 90, 39, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #a71d2a 100%);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.btn-delete-member {
    background: transparent;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
    margin-left: 0.5rem;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-delete-member:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #a71d2a;
}

/* ===== Forms ===== */
form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: var(--transition);
    background: var(--warm-white);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

input[readonly] {
    background: #f5f5f5;
    color: var(--text-muted);
}

/* ===== Alert Boxes ===== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #28a745;
    color: #155724;
}

.alert-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #dc3545;
    color: #721c24;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: 1px solid #17a2b8;
    color: #0c5460;
}

/* ===== Success Box (Giftee Assignment) ===== */
.success-box {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    border: 2px solid #28a745;
    text-align: center;
}

.success-box h3 {
    color: #155724;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.success-box p {
    font-size: 1.25rem;
    color: #155724;
}

.success-box strong {
    color: var(--forest-green);
    font-size: 1.5rem;
}

/* ===== Error Box ===== */
.error-box {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    border: 2px solid #dc3545;
}

.error-box p {
    color: #721c24;
    margin: 0;
}

/* ===== Lists ===== */
ul {
    list-style: none;
    padding: 0;
}

ul li {
    padding: 0.75rem 1rem;
    background: var(--warm-white);
    margin-bottom: 0.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-left: 4px solid var(--forest-green);
    transition: var(--transition);
}

ul li:hover {
    background: var(--cream);
}

.badge {
    background: var(--gold);
    color: var(--text-dark);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-owner {
    background: var(--primary-red);
    color: white;
}

.badge-success {
    background: #28a745;
    color: white;
}

/* ===== Signup Link Box ===== */
.link-box {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.link-box input {
    flex: 1;
    min-width: 200px;
}

.link-box button {
    padding: 0.875rem 1.25rem;
}

/* ===== Groups List (Dashboard) ===== */
.groups-list {
    display: grid;
    gap: 1rem;
}

.group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--soft-shadow);
    border-left: 4px solid var(--primary-red);
    transition: var(--transition);
}

.group-item:hover {
    transform: translateX(5px);
    box-shadow: var(--card-shadow);
}

.group-item a {
    font-weight: 600;
    font-size: 1.1rem;
}

.group-item .member-count {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== Home Page Hero ===== */
.hero {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-red);
}

.hero .subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.hero .emoji {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

/* ===== Auth Forms ===== */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-container .auth-link {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
}

/* ===== Thank You Page ===== */
.thankyou-container {
    text-align: center;
    padding: 3rem 2rem;
}

.thankyou-container .emoji {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.thankyou-container h1 {
    color: var(--forest-green);
}

/* ===== 404 Page ===== */
.error-page {
    text-align: center;
    padding: 3rem 2rem;
}

.error-page .emoji {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.error-page h2 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    main {
        padding: 1rem;
        margin: 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    header::before,
    header::after {
        display: none;
    }

    section, .card {
        padding: 1.25rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .link-box {
        flex-direction: column;
    }

    .link-box input,
    .link-box button {
        width: 100%;
    }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main {
    animation: fadeIn 0.5s ease;
}

/* ===== Snowflake decoration ===== */
.decoration {
    text-align: center;
    margin: 1rem 0;
    opacity: 0.6;
    letter-spacing: 1rem;
}
