/* 
   style.css 
   Modern UI elements for the 2026 Holiday Planner App
*/

:root {
    /* Colors */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --danger: #ef4444;
    --danger-hover: #dc2626;

    --ferie: #10b981;
    --ferie-light: #d1fae5;

    --permessi: #f59e0b;
    --permessi-light: #fef3c7;

    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    --weekend-bg: #f1f5f9;
    --weekend-text: #94a3b8;

    /* Layout */
    --radius-lg: 16px;
    --radius-md: 10px;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    padding: 20px;
}

/* Base Classes */
.glass-panel {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    padding: 24px;
    transition: box-shadow 0.3s ease;
}

.glass-panel:hover {
    box-shadow: var(--shadow-hover);
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.divider {
    width: 1px;
    height: 24px;
    background-color: var(--border-color);
    margin: 0 12px;
}

.divider-horizontal {
    height: 1px;
    width: 100%;
    background-color: var(--border-color);
    margin: 24px 0;
}

/* Buttons */
.btn {
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: var(--bg-color);
    border-color: #cbd5e1;
}

.btn-danger {
    background-color: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-danger:hover {
    background-color: var(--danger);
    color: white;
}

/* Layout Definitions */
.app-container {
    width: 100%;
    max-width: 100vw;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
}

.header-title h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Left / Right Division */
.main-layout {
    display: flex;
    flex-direction: column;
    /* Force vertical flow */
    gap: 24px;
    align-items: stretch;
}

.dashboard,
.vertical-dashboard {
    width: 100%;
    /* Take full width, no more 750px limits */
}

.calendar {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
}

/* Ensure spacing between panels */
.section-spacing {
    margin-top: 24px;
}

/* Settings Inputs */
.settings-grid {
    display: flex;
    gap: 16px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.input-group input,
.input-group select {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--primary);
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th,
td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

th {
    background-color: var(--bg-color);
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

td input[type="number"] {
    width: 85px;
    /* Increased from 70px to fit 3 decimals like 152.842 */
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
    font-family: inherit;
}

.negative-saldo {
    color: var(--danger);
    font-weight: 700;
}

.positive-saldo {
    color: var(--ferie);
    font-weight: 700;
}

/* Calendar Section */
.calendar-header h2 {
    margin-bottom: 16px;
}

.month-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.month-btn {
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
}

.month-btn:hover {
    background: var(--bg-color);
    color: var(--text-main);
}

.month-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}

/* Calendar Grid */
#calendar-table th,
#calendar-table td {
    padding: 8px;
    text-align: center;
    min-width: 44px;
    border-right: 1px solid var(--border-color);
}

#calendar-table th:first-child,
#calendar-table td:first-child {
    text-align: left;
    min-width: 150px;
    font-weight: 600;
    position: sticky;
    left: 0;
    background: white;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.02);
}

.day-weekend {
    background-color: var(--weekend-bg);
    color: var(--weekend-text);
}

.day-holiday {
    background-color: #fee2e2;
    color: #ef4444;
}

.cal-cell {
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 600;
    font-size: 0.85rem;
}

.cal-cell:hover:not(.day-weekend):not(.day-holiday):not(.has-entry) {
    background-color: #f1f5f9;
}

/* Cell Status */
.has-entry {
    color: white;
    border-radius: 4px;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.entry-F {
    background-color: var(--ferie) !important;
}

.entry-P {
    background-color: var(--permessi) !important;
}

/* Legends */
.legend {
    display: flex;
    gap: 16px;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-ferie {
    background-color: var(--ferie);
}

.badge-permessi {
    background-color: var(--permessi);
}

.badge-weekend {
    background-color: var(--weekend-bg);
    border: 1px solid var(--border-color);
}

.badge-holiday {
    background-color: #fee2e2;
    border: 1px solid #fca5a5;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal {
    width: 100%;
    max-width: 400px;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.show .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--danger);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Login overlay - always on top */
#login-overlay {
    z-index: 2000;
}

#login-overlay .modal {
    max-width: 380px;
}

/* Notification panel animation */
#notification-panel {
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}