* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Black/Grey/Orange Palette */
    --primary-gradient: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
    /* Orange Gradient */
    --secondary-gradient: linear-gradient(135deg, #fb923c 0%, #fdba74 100%);
    /* Lighter Orange */
    --accent-gradient: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
    /* Deep Orange */
    --success-gradient: linear-gradient(135deg, #059669 0%, #34d399 100%);
    /* Keep Green for Success */

    --dark-bg: #09090b;
    /* Zinc 950 */
    --dark-surface: #18181b;
    /* Zinc 900 */
    --glass-bg: rgba(24, 24, 27, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);

    --text-primary: #f4f4f5;
    /* Zinc 100 */
    --text-secondary: #a1a1aa;
    /* Zinc 400 */
    --text-muted: #71717a;
    /* Zinc 500 */

    --theme-orange: #f97316;
    --theme-black: #09090b;
    --theme-grey: #27272a;
    --theme-primary-rgb: 249, 115, 22;

    /* Legacy Support */
    --border-color: #3f3f46;
    --primary-color: #f97316;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #09090b url('../app_background.png') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    flex-direction: column;
    /* Ensure stacking context */
    padding-left: 280px;
    /* Reserve space for sidebar */
    transition: padding-left 0.3s ease;
}

/* Glassmorphism Overlay - Updated for Visibility */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    /* Much clearer overlay */
    backdrop-filter: blur(4px);
    /* Light blur */
    pointer-events: none;
    z-index: -1;
}

/* ... headers ... */
h1 {
    font-size: 3.5rem;
    margin-bottom: 0.75rem;
    color: #ffffff;
    text-shadow: 0 0 30px rgba(var(--theme-primary-rgb), 0.4);
    /* Orange Glow */
    font-weight: 800;
    letter-spacing: -0.02em;
    position: relative;
    display: inline-block;
}

/* Optional: Add a subtle underline accent to H1 */
h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent-gradient);
    margin: 0.5rem auto 0;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(var(--theme-primary-rgb), 0.5);
}

p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.6;
}

button {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 20px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(var(--theme-primary-rgb), 0.4);
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before {
    width: 300px;
    height: 300px;
}

button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(var(--theme-primary-rgb), 0.6);
}

/* ... sidebar ... */

/* Modern Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background:
        linear-gradient(to bottom, rgba(24, 24, 27, 0.4), rgba(24, 24, 27, 0.6)),
        url('../sidebar_bg.png') no-repeat center center;
    background-size: cover;
    /* Glassy Sidebar */
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2.5rem 1.5rem;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    color: var(--text-primary);
    z-index: 1000;
}

.sidebar .logo {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    /* Slightly squarer for tech look */
    padding: 0;
    background: transparent;
    box-shadow: 0 0 20px rgba(var(--theme-primary-rgb), 0.2);
    transition: all 0.3s ease;
    object-fit: cover;
    border: 1px solid #3f3f46;
}

/* Removed breathe animation loop for cleaner look, kept hover */

.sidebar .logo:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(var(--theme-primary-rgb), 0.5);
    border-color: var(--theme-orange);
}

.sidebar h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(90deg, #fff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.sidebar nav {
    flex: 1;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    /* Avoid scrollbar covering content */
}

/* Sidebar Scrollbar */
.sidebar nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar nav::-webkit-scrollbar-thumb {
    background: #3f3f46;
    border-radius: 3px;
}

.sidebar nav::-webkit-scrollbar-thumb:hover {
    background: var(--theme-orange);
}

.sidebar nav ul li a {
    color: #a1a1aa;
    text-decoration: none;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.875rem 1.25rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.sidebar nav ul li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--theme-orange);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.sidebar nav ul li a:hover::before {
    transform: scaleY(1);
}

.sidebar nav ul li a:hover {
    background: #27272a;
    color: #fff;
    border-color: #3f3f46;
    padding-left: 1.5rem;
}

.sidebar nav ul li a.active {
    background: #27272a;
    color: var(--theme-orange);
    font-weight: 700;
    border: 1px solid #3f3f46;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}




#root {
    width: 100%;
}

/* Table styling */
table {
    border-spacing: 0;
    overflow: hidden;
    border-radius: 12px;
}

table td {
    transition: all 0.3s ease;
}

table tr:hover td {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

table td:first-child {
    font-weight: 600;
    background: rgba(39, 39, 42, 0.85) !important;
    /* Semi-transparent Zinc 800 */
    backdrop-filter: blur(8px);
    /* Zinc 800 */
    position: relative;
    overflow: hidden;
    color: var(--theme-orange);
    /* Orange Text */
}

table td:first-child::after {
    display: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--dark-surface);
}

::-webkit-scrollbar-thumb {
    background: #3f3f46;
    /* Zinc 700 */
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--theme-orange);
    /* Orange */
}

/* ... existing media queries ... */

/* New Component Styles */
.home-container,
.app-container {
    margin-top: 2rem;
    margin-right: 2rem;
    min-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: none;
    width: auto;
}

.table-wrapper {
    width: 100%;
    margin: 2rem auto;
    flex: 1;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-top: 1rem;
}

.premium-table tr {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.premium-table tr:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.premium-table td {
    padding: 1.5rem;
    background: rgba(24, 24, 27, 0.6);
    /* Semi-transparent cells */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* Zinc 800 */
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.premium-table td:first-child {
    width: 35%;
    color: #f4f4f5;
    /* Zinc 100 */
    font-weight: 600;
    background: rgba(39, 39, 42, 0.8);
    backdrop-filter: blur(12px);
    /* Zinc 800 */
    border-right: none;
    border-radius: 12px 0 0 12px;
    position: relative;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.premium-table td:last-child {
    border-left: none;
    border-radius: 0 12px 12px 0;
    background: #18181b;
}

/* Accent line on the left of the first cell */
.premium-table td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 4px;
    background: var(--theme-orange);
    /* Orange */
    border-radius: 0 4px 4px 0;
    opacity: 1;
    box-shadow: 0 0 12px rgba(var(--theme-primary-rgb), 0.4);
}

.premium-table tr:hover td:first-child {
    background: #3f3f46;
    color: #fff;
}

.premium-table tr:hover td:last-child {
    background: #27272a;
}

/* Input Styles */
.input-group {
    margin-bottom: 1rem;
    width: 100%;
    text-align: left;
}

.input-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    letter-spacing: 1px;
    font-weight: 600;
}

.premium-input {
    width: 100%;
    background: #18181b;
    border: 1px solid #3f3f46;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.premium-input:focus {
    outline: none;
    border-color: #f97316;
    background: #09090b;
    box-shadow: 0 0 0 4px rgba(var(--theme-primary-rgb), 0.1);
}

.premium-textarea {
    width: 100%;
    background: #18181b;
    border: 1px solid #3f3f46;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    min-height: 120px;
    resize: vertical;
}

.premium-textarea:focus {
    outline: none;
    border-color: var(--theme-orange);
    box-shadow: 0 0 0 4px rgba(var(--theme-primary-rgb), 0.1);
}

/* Component Container - Glass Card */
.component-container {
    background: rgba(30, 30, 35, 0.3);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    margin: 2rem;
    padding: 2.5rem;
    max-width: 1400px;
    width: 90%;
}



/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        width: 80px;
        padding: 1.5rem 0.5rem;
    }

    .sidebar h2 {
        font-size: 0;
    }

    .sidebar nav ul li a {
        justify-content: center;
        padding: 0.75rem;
    }

    /* Update Body Padding for mobile/tablet */
    body {
        padding-left: 80px;
        /* Smaller collapsed sidebar space */
    }

    .container {
        width: 100%;
        max-width: none;
        padding: 2rem;
        /* Ensure specific container adjustments correspond to full width of remaining space */
    }
}

@media (max-width: 480px) {
    body {
        padding-left: 0;
        /* No sidebar on phone */
    }

    .container {
        margin-left: 0;
        width: 100%;
        border-radius: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .sidebar {
        display: none;
        /* Hide sidebar on very small screens for login/welcome focus */
    }
}

/* Specific Login Container Responsive Logic */
#login-container {
    width: clamp(300px, 50vw, 800px);
    /* Dynamic width: min 300px, ideal 50%, max 800px */
    padding: clamp(2rem, 5vw, 5rem);
    /* Dynamic padding based on viewport width */
    max-width: 95%;
    /* Ensure it never touches the very edges on small text scaling */

    /* Ensure flex centering even within the container */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#login-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    /* Dynamic font size for the title */
    line-height: 1.2;
}

#login-subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
}

#login-btn {
    width: clamp(200px, 50%, 400px);
    /* Button width scales with container */
    padding: clamp(12px, 1.5vw, 20px);
    font-size: clamp(1rem, 1.2vw, 1.3rem);
}

/* Tablet Adjustments for Login */
@media (max-width: 1024px) {
    #login-container {
        width: 70vw;
    }
}

/* Mobile Adjustments for Login */
@media (max-width: 768px) {
    #login-container {
        width: 90vw;
        margin-left: 0;
        /* Override general container margin if needed */
    }

    /* Adjust general container margin compensation specifically for login page as it likely has no sidebar or we want it centered regardless */
    body:has(#login-container) .sidebar {
        display: none;
        /* Optional: hide sidebar on login screen specifically if possible via CSS/JS class, specific rule here just in case */
    }
}

/* New Component Styles */
.home-container,
.app-container {
    margin-top: 2rem;
    margin-right: 2rem;
    min-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: none;
    width: auto;
}

.table-wrapper {
    width: 100%;
    margin: 2rem auto;
    flex: 1;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    /* Adds spacing between rows for a card-like feel */
    margin-top: 1rem;
}

.premium-table tr {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.premium-table tr:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.premium-table td {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.premium-table td:first-child {
    width: 35%;
    color: #f4f4f5;
    /* Zinc 100 */
    font-weight: 600;
    background: #27272a;
    /* Zinc 800 */
    border-right: none;
    border-radius: 12px 0 0 12px;
    position: relative;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.premium-table td:last-child {
    border-left: none;
    border-radius: 0 12px 12px 0;
    background: rgba(30, 41, 59, 0.3);
}

/* Accent line on the left of the first cell */
.premium-table td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 3px;
    background: var(--primary-gradient);
    border-radius: 0 4px 4px 0;
    opacity: 1;
    box-shadow: 0 0 12px rgba(var(--theme-primary-rgb), 0.4);
}

.premium-table tr:hover td:first-child {
    background: #3f3f46;
    /* Zinc 700 */
    color: #fff;
}

.premium-table tr:hover td:last-child {
    background: #27272a;
    /* Zinc 800 */
}

/* Input Styles */
.input-group {
    margin-bottom: 1rem;
    width: 100%;
    text-align: left;
}

.input-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    letter-spacing: 1px;
    font-weight: 600;
}

.premium-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.premium-input:focus {
    outline: none;
    border-color: var(--theme-orange);
    background: #09090b;
    box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb), 0.15);
}

.premium-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    min-height: 120px;
    resize: vertical;
}

.premium-textarea:focus {
    outline: none;
    border-color: var(--theme-orange);
    box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb), 0.15);
}

.numbered-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.number-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 0.75rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.sub-section {
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem;
    border-radius: 12px;
    margin-top: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Org Chart Styles */
.org-chart-container {
    width: 90% !important;
    max-width: 1200px !important;
}

.org-board {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    width: 100%;
}

.pool-column {
    min-width: 250px;
    width: 25%;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.departments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    flex: 1;
    width: 100%;
}

.dept-column {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 200px;
    transition: all 0.3s ease;
}

.dept-column:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.column-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    border-bottom: 2px solid;
    padding-bottom: 0.5rem;
    border-image: var(--primary-gradient) 1;
}

.card-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 100px;
    /* Drop target area */
}

.employee-card {
    background: rgba(40, 40, 40, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: grab;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.employee-card:hover {
    transform: translateY(-2px);
    background: rgba(60, 60, 60, 0.8);
    border-color: #10b981;
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

.employee-card:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.card-info {
    display: flex;
    flex-direction: column;
}

.emp-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.emp-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
    padding: 1rem;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

/* Action Buttons in Tables */
.action-btn {
    margin-top: 0 !important;
    /* Override default button margin */
    padding: 8px 16px !important;
    font-size: 0.9rem !important;
    border-radius: 8px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    font-weight: 600;
}

.edit-btn {
    background: linear-gradient(135deg, #eab308 0%, #fde047 100%) !important;
    color: #000 !important;
    box-shadow: 0 4px 15px rgba(234, 179, 8, 0.3) !important;
    border: none !important;
}

.delete-btn {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3) !important;
    border: none !important;
}

.edit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(234, 179, 8, 0.5) !important;
}

.delete-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.5) !important;
}


/* Responsive Styles for Org Chart */
@media (max-width: 1024px) {
    .org-board {
        flex-direction: column;
    }

    .pool-column {
        width: 100%;
        display: flex;
        flex-direction: column;
        margin-bottom: 2rem;
    }

    .pool-column .card-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 1rem;
    }

    .employee-card {
        min-width: 200px;
    }
}

/* Sidebar Submenu Styling */
.sidebar nav ul ul {
    padding-left: 1.5rem;
    margin-top: 0.25rem;
    position: relative;
    list-style: none;
    /* Ensure no bullets */
}

.sidebar nav ul ul::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.sidebar nav ul ul li {
    margin: 0.25rem 0;
    width: 100%;
}

.sidebar nav ul ul li a {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    color: var(--text-muted);
    border-radius: 8px;
    /* Slightly smaller radius */
}

.sidebar nav ul ul li a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    padding-left: 1.25rem;
}

.sidebar nav ul ul li a::before {
    /* Use a thinner accent line for submenus */
    width: 2px;
}

/* =========================================
   Classy Login Page Styles
   ========================================= */

#login-page-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: url('../src/login_bg.png') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    /* Ensure it covers everything */
}

/* Overlay to darken background for better readability */
#login-page-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    /* Dark overlay */
    backdrop-filter: blur(8px);
    /* Blur effect on the background image */
    z-index: -1;
}

.login-card {
    background: rgba(25, 25, 25, 0.65);
    /* Dark semi-transparent background */
    backdrop-filter: blur(20px);
    /* Glassmorphism blur */
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 3rem 4rem;
    width: 100%;
    max-width: 450px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.login-subtitle {
    font-size: 1rem;
    color: #a1a1aa;
    font-weight: 400;
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-button {
    margin-top: 1rem;
    width: 100%;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    font-weight: 600;
    padding: 14px;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.5);
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    backdrop-filter: blur(8px);
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .login-card {
        padding: 2rem;
        max-width: 90%;
    }

    .login-title {
        font-size: 2rem;
    }
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #8b5cf6;
    /* Royal Purple */
}

input:focus+.slider {
    box-shadow: 0 0 1px #8b5cf6;
}

input:checked+.slider:before {
    -webkit-transform: translateX(20px);
    -ms-transform: translateX(20px);
    transform: translateX(20px);
}

/* --- GLOBAL RESPONSIVE OVERRIDES --- */

@media (max-width: 768px) {

    /* Responsive Tables */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .premium-table {
        min-width: 600px;
        /* Force scroll */
    }

    /* Modals */
    .modal-content {
        width: 90% !important;
        max-width: 90% !important;
        padding: 1.5rem !important;
    }

    /* Stack flex containers on mobile */
    .flex-stack-mobile {
        flex-direction: column !important;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2.5rem;
    }

    .premium-table {
        min-width: 500px;
    }

    /* Hide some redundant UI elements on mobile if needed */
    .hide-mobile {
        display: none !important;
    }
}

/* --- MEETING RUNNER RESPONSIVE --- */
@media (max-width: 900px) {
    .meeting-runner-container {
        flex-direction: column;
    }

    .meeting-runner-sidebar {
        width: 100% !important;
        min-width: 0 !important;
        height: 150px;
        flex: 0 0 150px;
        /* Fixed height for timeline at top */
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .meeting-runner-content {
        padding: 1.5rem !important;
    }
}

@media (max-width: 480px) {
    .meeting-runner-content {
        padding: 1rem !important;
    }

    .meeting-runner-sidebar h3 {
        font-size: 1rem;
    }
}

/* --- MEETING HEADER RESPONSIVE --- */
.meeting-title {
    font-size: 4rem;
}

.meeting-header {
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .meeting-header {
        flex-direction: column;
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .meeting-title {
        font-size: 2.5rem !important;
        /* Override inline if any remains or specificity */
    }

    .meeting-timer-container {
        text-align: left !important;
        width: 100%;
        display: flex;
        justify-content: space-between;
        /* Timer on one side, controls on other? */
        align-items: center;
        flex-direction: row-reverse;
        /* Put controls on right, timer on left? */
    }

    /* Override inline styles for timer text alignment if needed */
    .meeting-timer-container>div:first-child {
        font-size: 2.5rem !important;
    }
}

/* Container fixes for mobile */
@media (max-width: 480px) {

    .home-container,
    .app-container {
        margin-right: 0 !important;
        margin-top: 1rem !important;
        padding: 1rem !important;
        width: 100% !important;
    }
}

/* --- REFINED MEETING SIDEBAR FOR MOBILE --- */
@media (max-width: 900px) {
    .meeting-runner-sidebar {
        flex-direction: row !important;
        height: auto !important;
        flex: 0 0 auto !important;
        align-items: center;
        overflow-x: auto;
        white-space: nowrap;
        padding: 0.5rem !important;
    }

    /* Target the Header (Title + Progress) */
    .meeting-runner-sidebar>div:first-child {
        min-width: 120px;
        width: 120px;
        padding: 0.5rem !important;
        border-bottom: none !important;
        flex-shrink: 0;
    }

    /* Target the Agenda List */
    .meeting-runner-sidebar>div:nth-child(2) {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto;
        padding: 0 1rem !important;
        gap: 0.5rem;
        flex: 1;
        border: none;
        align-items: center;
    }

    /* Agenda Items styling adjust for horizontal */
    .meeting-runner-sidebar>div:nth-child(2)>div {
        min-width: 100px;
        /* Card width */
        margin-bottom: 0 !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 0.5rem !important;
    }

    /* Hide duration on very small screens to save space? Or keep it small */

    /* Target Footer (End Button) */
    .meeting-runner-sidebar>div:last-child {
        border-top: none !important;
        padding: 0.5rem !important;
        min-width: 100px;
    }
}

/* --- MOBILE MENU IMPLEMENTATION --- */

/* 1. Mobile Toggle Button */
.mobile-menu-btn {
    display: none;
    /* Hidden on Desktop */
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 2000;
    /* Above sidebar */
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    width: 44px;
    height: 44px;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* 2. Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
    z-index: 999;
    /* Below sidebar, above content */
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 3. Responsive Logic (Max Width 900px covers tablets & mobile) */
@media (max-width: 900px) {

    /* Show Toggle Button */
    .mobile-menu-btn {
        display: flex;
    }

    /* Transform Sidebar for Mobile */
    .sidebar {
        display: flex !important;
        /* Override previous display:none */
        transform: translateX(-100%);
        /* Start hidden off-screen */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: 280px !important;
        /* Ensure fixed width */
        z-index: 1000;
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
    }

    /* Adjust Body Padding */
    body {
        padding-left: 0 !important;
    }

    /* Active State (Menu Open) */
    body.mobile-menu-open .sidebar {
        transform: translateX(0);
    }

    body.mobile-menu-open .mobile-overlay {
        display: block;
        opacity: 1;
    }

    /* Hamburger Animation when Open */
    body.mobile-menu-open .mobile-menu-btn span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    body.mobile-menu-open .mobile-menu-btn span:nth-child(2) {
        opacity: 0;
    }

    body.mobile-menu-open .mobile-menu-btn span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

/* --- COMPONENT ALIGNMENT FIXES FOR MOBILE --- */

@media (max-width: 768px) {

    /* 1. Rocks Input: Stack vertically */
    .rock-input-row,
    .headline-input-row {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }

    .rock-input-row select,
    .headline-input-row select,
    .rock-input-row button,
    .headline-input-row button {
        width: 100% !important;
    }

    /* 2. Headlines Grid: Make full width cards */
    .headlines-grid {
        grid-template-columns: 1fr !important;
    }

    /* 3. To-Do Items: Adjust layout for small screens */
    .todo-item {
        flex-wrap: nowrap;
        /* Don't wrap checkbox over text, keep side by side but specific widths */
        gap: 1rem;
    }

    .todo-checkbox {
        width: 24px !important;
        /* Fix large checkbox width */
        flex-shrink: 0;
    }
}

/* Confirmation Modal Z-Index fix */
.confirmation-modal-overlay {
    z-index: 2000 !important;
}

.confirmation-modal-content {
    z-index: 2001 !important;
}