/* Fonts and Global Reset */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-green: #16A34A;
    --primary-green-hover: #166534;
    --primary-green-light: #ECFDF5;
    --accent-green-bg: rgba(22, 163, 74, 0.05);
    
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;
    
    --bg-main: #F8FAFC;
    --bg-gradient: linear-gradient(135deg, #F8FAFC 0%, #FFFFFF 100%);
    
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(22, 163, 74, 0.12);
    --glass-shadow: 0 10px 30px -10px rgba(22, 163, 74, 0.08);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: var(--bg-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(5, 150, 105, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(5, 150, 105, 0.4);
}

/* Glassmorphism utility card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--glass-shadow);
    padding: 24px;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}
.glass-card:hover {
    box-shadow: 0 20px 40px -15px rgba(5, 150, 105, 0.12);
}

/* Layout containers */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
main {
    flex-grow: 1;
    padding: 30px 0;
}

/* Header & Navigation */
header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(5, 150, 105, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}
.logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-green);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo i {
    font-size: 24px;
}
.nav-links {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 20px;
}
.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}
.nav-link:hover, .nav-link.active {
    color: var(--primary-green);
    background: var(--accent-green-bg);
}
.user-profile-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 1px solid rgba(0,0,0,0.08);
    padding-left: 20px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}
.btn-primary {
    background: var(--primary-green);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-green-hover);
    transform: translateY(-1px);
}
.btn-secondary {
    background: var(--primary-green-light);
    color: var(--primary-green-hover);
}
.btn-secondary:hover {
    background: rgba(5, 150, 105, 0.2);
}
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary-green);
    color: var(--primary-green);
}
.btn-outline:hover {
    background: var(--accent-green-bg);
}
.btn-danger {
    background: #ef4444;
    color: white;
}
.btn-danger:hover {
    background: #dc2626;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}
.btn:active {
    transform: scale(0.97);
}

/* Hero Section (Index Page) */
.hero {
    text-align: center;
    padding: 60px 20px;
    max-width: 800px;
    margin: 0 auto;
}
.hero h1 {
    font-size: 48px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 20px;
}
.hero h1 span {
    color: var(--primary-green);
}
.hero p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 30px;
}
.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 40px;
}
.feature-card {
    text-align: center;
    padding: 30px 20px;
}
.feature-card i {
    font-size: 32px;
    color: var(--primary-green);
    margin-bottom: 15px;
}
.feature-card h3 {
    margin-bottom: 10px;
    font-size: 18px;
}
.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Forms styling */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}
.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}
.form-control {
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(5, 150, 105, 0.2);
    font-family: inherit;
    font-size: 14px;
    background: rgba(255,255,255,0.7);
    color: var(--text-primary);
    transition: var(--transition-fast);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-green);
    background: white;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316A34A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}
select.form-control:hover {
    border-color: rgba(22, 163, 74, 0.5);
}
/* Стилизация выпадающего списка опций внутри браузера */
select.form-control option {
    background: white;
    color: var(--text-primary);
    padding: 10px;
}
.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}
.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-green);
}

/* Toast Messages & Flash */
.flash-messages {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 90%;
    max-width: 450px;
    pointer-events: none;
}
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 500;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    animation: dropDown 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    pointer-events: auto;
}
.alert-success { background: #10b981; }
.alert-danger { background: #ef4444; }
.alert-warning { background: #f59e0b; }
.alert-info { background: #3b82f6; }
.alert-close {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 20px;
    opacity: 0.8;
    line-height: 1;
    padding: 0 4px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.alert-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

@keyframes dropDown {
    from { transform: translateY(-150%) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Badges styling */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
}
.badge-root { background: #fef3c7; color: #d97706; }
.badge-admin { background: #dbeafe; color: #2563eb; }
.badge-user { background: #f1f5f9; color: #475569; }

.badge-active { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-completed { background: #f1f5f9; color: #475569; }

.badge-repair { background: #fef3c7; color: #92400e; }
.badge-unavailable { background: #ffedd5; color: #c2410c; }

/* Interactive Calendar Grid UI */
.calendar-filters {
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.calendar-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}
.calendar-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}
.calendar-grid-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    background: white;
}
.calendar-grid {
    display: grid;
    grid-template-columns: 80px repeat(7, minmax(140px, 1fr));
    min-width: 800px;
}
.calendar-cell {
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px;
    min-height: 80px;
    position: relative;
}
.calendar-cell:last-child {
    border-right: none;
}
.calendar-header-cell {
    background: #f8fafc;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    padding: 12px 5px;
    border-bottom: 2px solid #cbd5e1;
    color: var(--text-secondary);
}
.calendar-header-cell.today {
    background: var(--primary-green-light);
    color: var(--primary-green-hover);
}
.calendar-time-cell {
    background: #f8fafc;
    font-weight: 500;
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #e2e8f0;
}
/* Booking cards inside calendar cell */
.calendar-booking-card {
    background: #ecfdf5;
    border-left: 4px solid var(--primary-green);
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    color: var(--text-primary);
    display: block;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.calendar-booking-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(5, 150, 105, 0.12);
    background: var(--primary-green-light);
}
.booking-card-time {
    font-weight: 600;
    color: var(--primary-green-hover);
    margin-bottom: 2px;
}
.booking-card-title {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.booking-card-room {
    font-size: 10px;
    color: var(--text-secondary);
}

/* Rooms Page Cards */
.rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.room-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.room-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}
.room-details {
    list-style: none;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}
.room-details li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.room-details i {
    color: var(--primary-green);
    width: 16px;
}
.room-card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

/* Notifications and Dashboard lists */
.notification-item {
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}
.notification-item:last-child {
    border-bottom: none;
}
.notification-unread {
    background: var(--accent-green-bg);
    margin: 0 -24px;
    padding: 15px 24px;
    border-left: 4px solid var(--primary-green);
}
.notification-time {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
}
.notification-message {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Data Tables inside dashboards */
.table-wrapper {
    overflow-x: auto;
    margin-top: 15px;
}
.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}
.table th {
    background: var(--accent-green-bg);
    color: var(--primary-green-hover);
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 2px solid var(--glass-border);
}
.table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    color: var(--text-secondary);
    vertical-align: middle;
}
.table tbody tr:hover {
    background: rgba(0,0,0,0.01);
}

/* Analytics & charts grids */
.analytics-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.summary-card {
    display: flex;
    align-items: center;
    gap: 20px;
}
.summary-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--primary-green-light);
    color: var(--primary-green-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.summary-data h4 {
    font-size: 13px;
    color: var(--text-light);
    text-transform: uppercase;
}
.summary-data p {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}
.chart-container {
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    padding: 20px;
    min-height: 300px;
}

/* Footer elements */
footer {
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
    margin-top: 40px;
}

/* Responsive updates */
@media(max-width: 768px) {
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
        gap: 15px;
    }
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        padding-bottom: 10px;
    }
    .user-profile-nav {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid rgba(0,0,0,0.08);
        padding-top: 10px;
        width: 100%;
        justify-content: center;
    }
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .hero h1 {
        font-size: 32px;
    }
}
