/* --- css/style.css --- */

/* 1. Global Color Variables */
:root {
    /* LIGHT MODE (Default) - Joyful, warm, soft */
    --bg-color: #FFFDF8;       /* Very soft cream, not pure white */
    --card-bg: #FFFFFF;        /* Pure white for recipe/login cards */
    --text-main: #4A3F35;      /* Soft dark brown instead of harsh black */
    --text-muted: #888888;
    --primary: #FF9E5E;        /* Joyful Tangerine */
    --primary-hover: #E65100;
    --secondary: #FFC107;      /* Sunflower Yellow */
    --border-color: #FFE0B2;
    --success: #81C784;
    --danger: #E57373;
}

[data-theme="dark"] {
    /* DARK MODE - Cozy, easy on the eyes */
    --bg-color: #1A1614;       /* Deep, warm dark gray/brown */
    --card-bg: #2A2421;        /* Slightly lighter for cards */
    --text-main: #EAE0D5;      /* Soft off-white text */
    --text-muted: #A0968D;
    --primary: #E07A5F;        /* Muted tangerine so it doesn't burn the eyes */
    --primary-hover: #D0674C;
    --secondary: #E3B04B;      /* Muted sunflower */
    --border-color: #3D342E;
    --success: #66BB6A;
    --danger: #EF5350;
}

/* 2. Base Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease; /* Smooth fade when toggling modes */
}

/* 3. Auth Page Specific Styles */
.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: var(--card-bg);
    width: 100%;
    max-width: 400px;
    padding: 30px 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: background-color 0.3s ease;
}

.auth-logo {
    font-size: 3em;
    color: var(--primary);
    margin-bottom: 10px;
}

.auth-title {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 25px;
    color: var(--text-main);
}

/* 4. Form Elements */
.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.9em;
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 5px;
    padding-left: 5px;
}

.input-joy {
    width: 100%;
    padding: 14px 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1em;
    background-color: transparent;
    color: var(--text-main);
    transition: all 0.3s ease;
}

.input-joy:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 158, 94, 0.2);
}

/* 5. Buttons */
.btn-main {
    width: 100%;
    padding: 14px;
    background-color: var(--primary);
    color: #FFFFFF; /* Keep white text on primary button even in dark mode */
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    margin-top: 10px;
}

.btn-main:active {
    background-color: var(--primary-hover);
    transform: scale(0.98);
}

/* Secondary / Outline Button */
.btn-secondary {
    width: 100%;
    padding: 14px;
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
    display: block; /* Ensures links fill the width like buttons */
    text-decoration: none;
    text-align: center;
}

.btn-secondary:hover {
    background-color: rgba(255, 158, 94, 0.1); /* Adds a soft orange glow on hover */
    transform: scale(0.98);
}

/* Dark mode adjustment for the hover state */
[data-theme="dark"] .btn-secondary:hover {
    background-color: rgba(224, 122, 95, 0.15); 
}

.toggle-link {
    display: inline-block;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.9em;
    cursor: pointer;
    text-decoration: underline;
}

/* 6. Alerts */
.alert {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9em;
    font-weight: bold;
}
.alert-error { border: 1px solid var(--danger); color: var(--danger); }
.alert-success { border: 1px solid var(--success); color: var(--success); }


/* 7. Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    animation: fadeInModal 0.2s forwards;
}

.modal-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 350px;
    width: 90%;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    transform: translateY(20px);
    animation: slideUpModal 0.3s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border-color);
}

.modal-icon {
    font-size: 3.5em;
    color: var(--danger);
    margin-bottom: 15px;
}

.modal-content h3 {
    margin-bottom: 10px;
    color: var(--text-main);
    font-size: 1.4em;
}

.modal-content p {
    color: var(--text-muted);
    font-size: 0.95em;
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.btn-cancel {
    background: transparent;
    color: var(--text-main);
    border: 2px solid var(--border-color);
}

.btn-cancel:hover { background: var(--bg-color); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { filter: brightness(0.9); }

@keyframes fadeInModal { to { opacity: 1; } }
@keyframes slideUpModal { to { transform: translateY(0); } }


/* --- UI FIXES --- */

/* 1. Dimmer Placeholders */
.input-joy::placeholder {
    color: #B0A8A0; /* Much lighter and softer */
    opacity: 1;
}
[data-theme="dark"] .input-joy::placeholder {
    color: #6D645D;
}

/* 2. Beautiful File Upload Button */
.file-upload-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}
.file-upload-wrapper input[type=file] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
    height: 100%;
}
.btn-upload {
    background-color: transparent;
    border: 2px dashed var(--primary);
    color: var(--primary);
    padding: 15px;
    text-align: center;
    border-radius: 12px;
    font-weight: bold;
    display: block;
    width: 100%;
    transition: background-color 0.2s;
}
.file-upload-wrapper:hover .btn-upload {
    background-color: rgba(255, 158, 94, 0.1);
}

@keyframes fadeIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }