/* css/style.css */

/* --- Theme Variables (CSS Custom Properties) --- */
:root {
    --color-bg-primary: #0b1120; /* Deep, dark blue for the page background */
    --color-bg-secondary: #111827; /* Slightly lighter dark blue/gray - for floating containers */
    --color-bg-surface: #1f2937; /* For cards, inputs within containers */
    --color-bg-surface-hover: #374151; /* For hover states on surfaces */

    --color-text-primary: #e5e7eb; /* Light gray (slate-200) */
    --color-text-secondary: #cbd5e1; /* slate-300 for good contrast with Roboto */
    --color-text-muted: #94a3b8; /* slate-400 for placeholders, less important text */

    --color-accent-primary: #38bdf8; /* Vibrant Sky Blue */
    --color-accent-primary-hover: #0ea5e9; /* Darker Sky Blue */
    --color-accent-secondary: #f472b6; /* Rose Pink */
    --color-accent-secondary-hover: #ec4899;
    --color-accent-tertiary: #facc15; /* Amber/Gold for highlights, e.g., icons */

    --color-success: #22c55e; /* Green */
    --color-error: #ef4444; /* Red */
    --color-info: #60a5fa; /* Blue */

    --font-family-heading: 'Tilt Warp', sans-serif; /* Fallback to generic sans-serif */
    --font-family-base: 'Roboto', sans-serif; /* Fallback to generic sans-serif */

    --border-radius-sm: 0.25rem; /* 4px */
    --border-radius-md: 0.375rem; /* 6px */
    --border-radius-lg: 0.5rem; /* 8px */
    --border-radius-xl: 0.75rem; /* 12px, used for modal and floating container */

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.25), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.3), 0 10px 10px -5px rgba(0,0,0,0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.55); /* More pronounced for floating effect */
}

/* Global body styles */
body {
    font-family: var(--font-family-base);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    font-weight: 400; /* Roboto Regular */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex; /* For centering .page-center-wrapper */
    flex-direction: column;
    min-height: 100vh;
}

/* New wrapper for centering the main floating container */
.page-center-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertical centering */
    align-items: center;     /* Horizontal centering */
    flex-grow: 1;
    width: 100%;
    padding: 2rem 1rem;      /* Padding around the floating container */
    box-sizing: border-box;
    overflow-y: auto; /* Allow page wrapper to scroll if floating container is very tall (e.g. mobile) */
}

/* The main "floating card" container */
.floating-container {
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-bg-surface);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-2xl);
    padding: 2rem 2.5rem; /* Default padding, pages can override if class is combined */
    width: 100%;
    max-width: 1100px; /* Default max-width, can be overridden */
    margin: 0; /* Centering handled by .page-center-wrapper */
    display: flex;
    flex-direction: column;
    /* Consider a max-height related to viewport if content can be very long
       max-height: calc(100vh - 4rem); /* Example: viewport height minus wrapper padding */
    /* overflow: hidden; /* If max-height is set, children will scroll */
}

.floating-container-content { /* Inner wrapper for scrollable content if needed */
    flex-grow: 1;
    /* overflow-y: auto; /* Enable if you set a max-height on .floating-container */
    /* Custom scrollbar for webkit browsers (optional) */
}
.floating-container-content::-webkit-scrollbar { width: 8px; }
.floating-container-content::-webkit-scrollbar-track { background: var(--color-bg-surface); border-radius: 10px; }
.floating-container-content::-webkit-scrollbar-thumb { background-color: var(--color-text-muted); border-radius: 10px; border: 2px solid var(--color-bg-surface); }
.floating-container-content::-webkit-scrollbar-thumb:hover { background-color: var(--color-text-secondary); }


/* Styling for the footer now INSIDE the floating-container */
.site-footer-internal {
    width: 100%;
    text-align: center;
    padding: 1.5rem 0 0.75rem 0;
    margin-top: auto; /* Pushes footer to the bottom */
    border-top: 1px solid var(--color-bg-surface);
    flex-shrink: 0;
}
.site-footer-internal p {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-weight: 300; /* Roboto Light */
    margin: 0.1rem 0;
    opacity: 0.65;
}
.site-footer-internal p.powered-by {
    font-size: 0.7rem;
    opacity: 0.5;
}

/* General link styling */
a {
    color: var(--color-accent-primary);
    text-decoration: none;
    font-weight: 500; /* Roboto Medium */
    transition: color 0.2s ease, text-decoration-thickness 0.2s ease;
}
a:hover {
    color: var(--color-accent-primary-hover);
    text-decoration: underline;
    text-decoration-thickness: 1px;
}

/* Message area styling */
.message-area {
    padding: 0.85rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius-md);
    border-width: 1px;
    border-style: solid;
    font-weight: 400; /* Roboto regular */
}
.message-area.success { color: #d1fae5; background-color: rgba(16, 185, 129, 0.2); border-color: var(--color-success); }
.message-area.error { color: #fee2e2; background-color: rgba(239, 68, 68, 0.2); border-color: var(--color-error); }
.message-area.info { color: #dbeafe; background-color: rgba(59, 130, 246, 0.2); border-color: var(--color-info); }
.message-area p { margin: 0.25rem 0; }
.message-area p.font-bold { color: var(--color-text-primary); font-weight: 700; /* Roboto Bold */ }

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading); /* Tilt Warp */
    color: var(--color-text-primary);
    font-weight: normal;
    margin-bottom: 0.6em;
    line-height: 1.2;
    letter-spacing: 0.02em;
}
h1 { font-size: 3.25rem; }
h2 { font-size: 2.75rem; }
h3 { font-size: 2.25rem; }
h4 { font-size: 1.85rem; }
h5 { font-size: 1.5rem; }
h6 { font-size: 1.25rem; }

/* Input Fields & Selects */
input[type="text"],
input[type="password"],
select,
textarea {
    background-color: var(--color-bg-surface);
    color: var(--color-text-primary);
    border: 1px solid transparent;
    border-bottom: 2px solid var(--color-text-muted);
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
    padding: 0.85rem 1rem;
    width: 100%;
    box-sizing: border-box;
    font-family: var(--font-family-base); /* Roboto */
    font-weight: 400; /* Roboto Regular */
    font-size: 1rem;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out, background-color 0.2s ease;
}
input[type="text"]::placeholder,
input[type="password"]::placeholder,
textarea::placeholder {
    color: var(--color-text-muted);
    opacity: 0.9;
    font-weight: 300; /* Roboto Light */
}
input[type="text"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    background-color: var(--color-bg-surface-hover);
    border-bottom-color: var(--color-accent-primary);
    box-shadow: 0 1px 0 0 var(--color-accent-primary);
    outline: none;
}
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E"); /* Updated stroke for muted text */
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25em;
    padding-right: 2.5rem;
}
select option { background-color: var(--color-bg-surface); color: var(--color-text-primary); font-family: var(--font-family-base); }

/* Buttons */
button, .button-style {
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-md);
    font-family: var(--font-family-base); /* Roboto */
    font-weight: 500; /* Roboto Medium */
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-sm);
    display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; line-height: 1.2;
}
button:hover, .button-style:hover { transform: translateY(-2px) scale(1.02); box-shadow: var(--shadow-md); }
button:active, .button-style:active { transform: translateY(0px) scale(1); box-shadow: inset 0 2px 4px 0 rgba(0,0,0,0.2); }

.btn-primary { background-color: var(--color-accent-primary); color: var(--color-bg-primary); border-color: var(--color-accent-primary); }
.btn-primary:hover { background-color: var(--color-accent-primary-hover); border-color: var(--color-accent-primary-hover); }
.btn-danger { background-color: var(--color-error); color: white; border-color: var(--color-error); }
.btn-danger:hover { background-color: #cc2f2f; border-color: #cc2f2f; }
.btn-secondary { background-color: var(--color-bg-surface-hover); color: var(--color-text-primary); border: 1px solid var(--color-text-muted); }
.btn-secondary:hover { background-color: var(--color-text-muted); color: var(--color-bg-primary); border-color: var(--color-text-muted); }
.btn-ghost { background-color: transparent; color: var(--color-text-secondary); border: 1px solid var(--color-bg-surface-hover); box-shadow: none; text-transform: none; letter-spacing: 0.02em; font-weight: 400; }
.btn-ghost:hover { background-color: var(--color-bg-surface); color: var(--color-text-primary); border-color: var(--color-text-muted); box-shadow: var(--shadow-sm); }
.btn-text-link { background-color: transparent; color: var(--color-text-secondary); padding: 0.25rem 0.5rem; text-transform: none; letter-spacing: 0.02em; font-weight: 400; box-shadow: none; border: none; }
.btn-text-link:hover { color: var(--color-accent-primary); text-decoration: underline; background-color: transparent; transform: none; box-shadow: none; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInUp { from { opacity: 0; transform: translateY(25px); } to { opacity: 1; transform: translateY(0); } }
.animate-fadeIn { animation: fadeIn 0.6s ease-out forwards; }
.animate-slideInUp { animation: slideInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }

/* Base styling for Google Material Symbols */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
  font-size: 1.2em; display: inline-block; vertical-align: -0.15em; line-height: 1;
  -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
}
.icon-sm { font-size: 0.9em !important; font-variation-settings: 'opsz' 20, 'wght' 300; }
.icon-md { font-size: 1.1em !important; font-variation-settings: 'opsz' 24, 'wght' 300; }
.icon-lg { font-size: 1.5em !important; font-variation-settings: 'opsz' 40, 'wght' 300; }
.icon-xl { font-size: 2em !important; font-variation-settings: 'opsz' 48, 'wght' 300; }
button .material-symbols-outlined, .button-style .material-symbols-outlined { font-size: 1em; line-height: inherit; }

/* --- Custom Modal Styles --- */
.custom-modal-overlay { /* Tailwind: fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center p-4 z-[100] hidden opacity-0 transition-opacity duration-300 ease-in-out */ }
.custom-modal-overlay.active { opacity: 1; }
.custom-modal-overlay.active .custom-modal { transform: scale(1) translateY(0); opacity: 1; }
.custom-modal { /* Tailwind: bg-slate-800 p-6 sm:p-8 rounded-xl shadow-2xl w-full max-w-lg transform transition-all duration-300 ease-out scale-95 opacity-0 */
    font-family: var(--font-family-base); /* Roboto */
    background-color: var(--color-bg-secondary); /* Use CSS var */
    border: 1px solid var(--color-bg-surface-hover);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-2xl);
}
.custom-modal-header { /* Tailwind: mb-5 pb-4 border-b border-slate-700 flex justify-between items-center */
    border-bottom-color: var(--color-bg-surface); /* Use CSS var */
}
.custom-modal-header h3 {
    font-family: var(--font-family-heading); /* Tilt Warp */
    color: var(--color-text-primary);
    font-size: 1.75rem; /* Adjusted for modal context */
    letter-spacing: 0.02em; line-height: 1.3; margin-bottom: 0;
}
#customModalCloseBtnHeader .material-symbols-outlined {
    font-size: 1.6rem; font-variation-settings: 'opsz' 28, 'wght' 300;
    color: var(--color-text-muted); transition: color 0.2s ease, transform 0.2s ease;
}
#customModalCloseBtnHeader:hover .material-symbols-outlined { color: var(--color-text-primary); transform: rotate(90deg); }
.custom-modal-body p#customModalMessage { color: var(--color-text-secondary); font-size: 1rem; line-height: 1.6; }
#customModalInput {
    font-family: var(--font-family-base); background-color: var(--color-bg-surface); color: var(--color-text-primary);
    border: 1px solid var(--color-bg-surface-hover); font-size: 1rem; padding: 0.75rem 1rem;
    border-radius: var(--border-radius-md);
}
#customModalInput:focus { border-color: var(--color-accent-primary); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25); }
#customModalInput.input-error { border-color: var(--color-error) !important; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important; }
#customModalInputError { color: var(--color-error); font-weight: 500; /* Roboto Medium */ }
.custom-modal-footer button { font-family: var(--font-family-base); font-weight: 500; padding: 0.7rem 1.3rem; letter-spacing: 0.04em; }
#customModalCancelBtn { /* Using .btn-secondary from global */ }
#customModalConfirmBtn { /* Using .btn-primary from global */ }
#customModalConfirmBtn.btn-danger-modal { background-color: var(--color-error); color: white; border-color: var(--color-error); }
#customModalConfirmBtn.btn-danger-modal:hover { background-color: #cc2f2f; border-color: #cc2f2f; }

/* --- Toast Notification Styles --- */
#toastContainer { /* Tailwind: fixed bottom-5 right-5 z-[150] w-full max-w-xs sm:max-w-sm space-y-3 */ }
.toast-message {
    font-family: var(--font-family-base); /* Roboto */
    color: var(--color-text-primary); padding: 0.9rem 1.25rem; border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg); border-left-width: 5px; border-style: solid;
    display: flex; align-items: center; gap: 0.75rem;
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out, visibility 0.3s ease-out;
    visibility: hidden; font-size: 0.9rem; line-height: 1.4;
}
.toast-message.show { opacity: 1; transform: translateY(0); visibility: visible; }
.toast-message.fade-out { opacity: 0; transform: translateY(10px) scale(0.95); } /* Can be removed if transition on .show removal is enough */
.toast-message.toast-success { background-color: rgba(34, 197, 94, 0.25); border-left-color: var(--color-success); }
.toast-message.toast-success .material-symbols-outlined { color: var(--color-success); }
.toast-message.toast-error { background-color: rgba(239, 68, 68, 0.25); border-left-color: var(--color-error); }
.toast-message.toast-error .material-symbols-outlined { color: var(--color-error); }
.toast-message.toast-info { background-color: rgba(59, 130, 246, 0.25); border-left-color: var(--color-info); }
.toast-message.toast-info .material-symbols-outlined { color: var(--color-info); }
.toast-message.toast-processing { background-color: rgba(100, 116, 139, 0.25); border-left-color: var(--color-text-muted); }
.toast-message.toast-processing .material-symbols-outlined { color: var(--color-text-muted); }
.toast-message .material-symbols-outlined { font-size: 1.5em; font-variation-settings: 'opsz' 24, 'wght' 400; }

/* Specific Login Page Floating Container Adjustments */
.login-page-container.floating-container {
    max-width: 28rem; /* Tailwind max-w-sm */
    padding: 2.5rem; /* More padding for login */
    margin-top: 0; /* Ensure it's truly centered by page-center-wrapper */
    margin-bottom: 0;
    /* For login, we usually don't want internal scrolling or max-height based on viewport */
    max-height: none;
    overflow: visible; /* Allow shadows to not be clipped if any */
}
.login-page-container .floating-container-content {
    overflow-y: visible; /* No scroll for login form content */
    padding-right: 0;
    margin-right: 0;
}