/* /static/css/common.css */
@import url('buttons.css');
@import url('buttons_hover.css');

/* --- :ROOT VARIABLES --- */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #dd6b20 100%);
    
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-muted: rgba(255, 255, 255, 0.6);
    
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.1);
    --border-radius: 16px;

    --color-success: #10b981;
    --color-danger: #ef4444;
}

/* --- BASE & LAYOUT --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background: var(--primary-gradient);
    background-size: 300% 300%;
    animation: gradientShift 8s ease infinite;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.container, .card, .login-container {
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-card);
    padding: 40px;
}

.container { max-width: 900px; margin: 0 auto; }
.card { max-width: 700px; margin: 0 auto; }
.login-container { max-width: 450px; margin: 0 auto; text-align: center; }

.hidden { display: none !important; }

/* --- TYPOGRAPHY --- */
h1, h2 {
    font-weight: 800;
    text-align: center;
    margin-bottom: 24px;
    color: var(--text-primary); /* Use the primary text color directly */
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2.2rem; }

/* Keep the status headers for specific pages like confirmations */
h1.status-header--success, h2.status-header--success { color: var(--color-success); }
h1.status-header--danger, h2.status-header--danger { color: var(--color-danger); }
h1.status-header--warning { color: #f59e0b; }


p { color: var(--text-secondary); margin-bottom: 20px; }
p.text-center { text-align: center; }
strong, b { color: var(--text-primary); font-weight: 600; }

/* The 'strong' tag inside a header should now be colored to stand out */
h1 strong, h2 strong {
    /* This effect is less problematic and can be kept for emphasis */
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

a { color: var(--text-muted); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--text-primary); }
/* --- FORMS & INPUTS --- */
form { display: flex; flex-direction: column; gap: 20px; }

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px; /* Use a positive margin for proper spacing */
    font-size: 0.95rem;
    color: var(--text-secondary); /* Ensure consistent color */
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="text"][pattern="\d{6}"],
textarea,
select {
    width: 100%;
    padding: 16px 20px;
    border-radius: var(--border-radius);
    border: 2px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

input[type="number"] {
    max-width: 150px;
    text-align: center;
}

.checkbox-container {
    display: flex;
    align-items: center; /* Vertically aligns the checkbox and text */
    gap: 0.75em;        /* Creates space between the checkbox and text */
    cursor: pointer;
    user-select: none;
    font-size: 1rem;
    padding: 10px 0;    /* Adds vertical spacing to match other inputs */
}

/* Hide the original checkbox */
.checkbox-container input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    flex-shrink: 0; /* Prevents the checkbox from shrinking */
    
    /* Sizing */
    width: 1.25em;
    height: 1.25em;

    /* Custom Box Style */
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 6px;
    transition: all 0.2s ease;
    
    /* For positioning the checkmark */
    position: relative; 
    display: grid;
    place-content: center;
}

/* Hover State */
.checkbox-container:hover input[type="checkbox"] {
    border-color: rgba(255, 255, 255, 0.6);
}

/* Checked State */
.checkbox-container input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    border-color: #7c3aed;
}

/* Create the checkmark using a pseudo-element */
.checkbox-container input[type="checkbox"]::before {
    content: '';
    width: 0.35em;
    height: 0.65em;
    border: solid white;
    border-width: 0 3px 3px 0;
    
    /* Hide by default */
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s ease;
}

/* Show the checkmark when the box is checked */
.checkbox-container input[type="checkbox"]:checked::before {
    transform: rotate(45deg) scale(1);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

textarea { resize: vertical; min-height: 120px; }
select option { background: #2d3748; color: white; }

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
/* --- BUTTONS --- */
.btn, button[type="submit"] {
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn:disabled, button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}


/* --- FLASH MESSAGES --- */
.flash-message {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid;
    font-weight: 500;
}
.flash-message--error {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-color: var(--color-danger);
}
.flash-message--success {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border-color: var(--color-success);
}

.toast-notification {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.1));
    backdrop-filter: blur(20px);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: 12px; /* Using a consistent radius */
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 1000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- SPECIALIZED COMPONENTS --- */
.info-box {
    background: rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 24px 0;
    text-align: left;
}
.info-box__title {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.info-box__content {
    font-style: italic;
    color: var(--text-secondary);
    margin: 0;
}
.task-box {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-top: 20px;
    text-align: left;
}

.task-box strong {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    display: block;
    margin-bottom: 12px;
}

.task-box__description {
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.task-box__meta {
    font-size: 0.9em;
    color: var(--text-muted);
}

.arrow {
    font-size: 2.5rem;
    text-align: center;
    margin: 16px 0;
    color: var(--text-muted);
    font-weight: 300;
}

@media (max-width: 768px) {
    body {
        font-size: 16px; /* Set a solid base font size for mobile */
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }

    p, label, select, input, textarea {
        font-size: 1rem; /* Ensure form elements and paragraphs are readable */
    }

    .btn, button[type="submit"] {
        padding: 16px 24px;
        font-size: 1rem; /* Increase button text size */
    }
}
