/* Room Management System - Main Stylesheet */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;

    --bg-color: #f8fafc;
    --bg-white: #ffffff;
    --bg-dark: #1e293b;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --text-white: #ffffff;

    --border-color: #e2e8f0;
    --border-radius: 8px;
    --border-radius-lg: 12px;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-sm {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-link:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

/* Mobile Menu Toggle */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-primary);
    border-radius: var(--border-radius);
}

.mobile-menu-btn:hover {
    background: var(--bg-color);
}

.mobile-menu-btn svg {
    display: block;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        padding: 15px 20px;
        gap: 5px;
        box-shadow: var(--shadow-md);
        border-top: 1px solid var(--border-color);
        z-index: 100;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-link {
        width: 100%;
        text-align: center;
        padding: 12px 16px;
    }

    .header-content {
        position: relative;
    }
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 30px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #16a34a;
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-white {
    background: white;
    color: var(--primary-color);
}

.btn-white:hover {
    background: var(--bg-color);
    color: var(--primary-dark);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
}

.card-header h2, .card-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-white);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
}

.form-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='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-text {
    margin-top: 6px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.invalid-feedback {
    margin-top: 6px;
    font-size: 0.875rem;
    color: var(--danger-color);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
}

.badge-new {
    background: #dbeafe;
    color: #1e40af;
}

.badge-accepted {
    background: #fef3c7;
    color: #92400e;
}

.badge-progress {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-resolved {
    background: #d1fae5;
    color: #065f46;
}

.badge-acknowledged {
    background: #cffafe;
    color: #0e7490;
}

.badge-closed {
    background: #f1f5f9;
    color: #475569;
}

.badge-cancelled {
    background: #fee2e2;
    color: #dc2626;
}

.badge-it {
    background: #fee2e2;
    color: #991b1b;
}

.badge-pantry {
    background: #dcfce7;
    color: #166534;
}

.badge-others {
    background: #f3e8ff;
    color: #6b21a8;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #f0fdf4;
    border-color: var(--success-color);
    color: #166534;
}

.alert-error {
    background: #fef2f2;
    border-color: var(--danger-color);
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border-color: var(--warning-color);
    color: #92400e;
}

.alert-info {
    background: #ecfeff;
    border-color: var(--info-color);
    color: #0e7490;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
}

.table tbody tr:hover {
    background: var(--bg-color);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.stat-new .stat-icon { background: #dbeafe; color: #1e40af; }
.stat-accepted .stat-icon { background: #fef3c7; color: #92400e; }
.stat-progress .stat-icon { background: #e0e7ff; color: #3730a3; }
.stat-resolved .stat-icon { background: #d1fae5; color: #065f46; }
.stat-pending .stat-icon { background: #cffafe; color: #0e7490; }

/* Home Page Specific */
.home-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.action-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    flex: 1;
    max-width: 300px;
    min-width: 250px;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

.action-card .icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2.5rem;
    color: white;
}

.action-card h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.action-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* Ticket Card */
.ticket-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.ticket-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
}

.ticket-id {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.ticket-body {
    padding: 20px;
}

.ticket-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.ticket-info-item {
    display: flex;
    flex-direction: column;
}

.ticket-info-item .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.ticket-info-item .value {
    font-weight: 500;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 25px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid var(--bg-white);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item .time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.timeline-item .action {
    font-weight: 500;
}

.timeline-item .description {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Star Rating */
.star-rating {
    display: inline-flex;
    gap: 4px;
}

.star {
    font-size: 1.5rem;
    color: var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.star.filled {
    color: #fbbf24;
}

.star-input {
    display: inline-flex;
    gap: 4px;
    flex-direction: row-reverse;
}

.star-input input {
    display: none;
}

.star-input label {
    font-size: 2rem;
    color: var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.star-input label:hover,
.star-input label:hover ~ label,
.star-input input:checked ~ label {
    color: #fbbf24;
}

/* Page Sections */
.page-section {
    padding: 40px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Sidebar Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-dark);
    color: var(--text-white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header .logo {
    color: white;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-nav .nav-section {
    padding: 0 15px;
    margin-bottom: 20px;
}

.sidebar-nav .nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 10px;
    padding-left: 10px;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: rgba(255,255,255,0.7);
    border-radius: var(--border-radius);
    margin-bottom: 5px;
    transition: var(--transition);
}

.sidebar-nav .nav-item:hover,
.sidebar-nav .nav-item.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-nav .nav-item .icon {
    font-size: 1.25rem;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.top-bar {
    background: var(--bg-white);
    padding: 15px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-content {
    padding: 30px;
}

.page-header {
    margin-bottom: 30px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.page-subtitle {
    color: var(--text-secondary);
}

/* User Dropdown */
.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-color);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Filters */
.filters-bar {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    padding: 20px;
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-backdrop.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.pagination a:hover {
    background: var(--bg-color);
}

.pagination .active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .sidebar {
        transform: translateX(-100%);
        z-index: 1000;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .home-actions {
        flex-direction: column;
        align-items: center;
    }

    .action-card {
        max-width: 100%;
    }

    .filters-bar {
        flex-direction: column;
    }

    .ticket-header {
        flex-direction: column;
        gap: 10px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 2rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

.hidden { display: none; }

/* Product Price and Stock Styling */
.product-price {
    display: block;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    margin: 4px 0;
}

.product-stock {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.product-stock.in-stock {
    background: #dcfce7;
    color: #166534;
}

.product-stock.out {
    background: #fee2e2;
    color: #dc2626;
}

.product-card.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
}

.product-card.out-of-stock:hover {
    border-color: var(--border-color);
    transform: none;
}
