/* styles.css */
:root {
    --primary-color: #0056b3;
    --primary-hover: #004494;
    --primary-light: #e3f2fd;
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --text-muted: #999;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --border-color: #dee2e6;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* Header */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow-sm);
}
.header-content { display: flex; align-items: center; justify-content: space-between; height: 64px; flex-wrap: wrap; gap: 8px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; color: var(--primary-color); }
.logo-icon { width: 28px; height: 28px; }
.nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nav-btn {
    padding: 8px 16px; background: transparent; border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); color: var(--text-primary); font-size: 14px;
    cursor: pointer; transition: var(--transition); text-decoration: none; display: inline-block;
}
.nav-btn:hover { background: var(--bg-secondary); border-color: var(--primary-color); color: var(--primary-color); }
.nav-btn.active {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.main { padding: 24px 0; }

/* Search */
.search-section {
    background: var(--bg-primary); border-radius: var(--radius-lg);
    padding: 20px; box-shadow: var(--shadow-sm); margin-bottom: 24px;
}
.search-box { display: flex; gap: 8px; margin-bottom: 16px; }
.search-input {
    flex: 1; padding: 12px 16px; border: 2px solid var(--border-color);
    border-radius: var(--radius-md); font-size: 16px; transition: var(--transition);
}
.search-input:focus { outline: none; border-color: var(--primary-color); }
.search-btn {
    padding: 12px 20px; background: var(--primary-color); border: none;
    border-radius: var(--radius-md); color: white; cursor: pointer;
    transition: var(--transition); display: flex; align-items: center; justify-content: center;
}
.search-btn:hover { background: var(--primary-hover); }
.search-btn svg { width: 20px; height: 20px; }

.filters-toggle {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px; background: var(--bg-secondary); border-radius: var(--radius-md);
    cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text-secondary);
    transition: var(--transition);
}
.filters-toggle:hover { background: var(--bg-tertiary); }
.filters-toggle svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.filters-toggle.active svg { transform: rotate(180deg); }

.filters-panel { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.filters-panel.active { max-height: 500px; margin-top: 16px; }
.filters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.checkbox input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary-color); }

/* Results */
.results-section {
    background: var(--bg-primary); border-radius: var(--radius-lg);
    padding: 20px; box-shadow: var(--shadow-sm);
}
.results-header { margin-bottom: 20px; }
.results-title { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.results-list { display: flex; flex-direction: column; gap: 16px; }

.room-card {
    display: flex; gap: 16px; padding: 16px; background: var(--bg-secondary);
    border-radius: var(--radius-md); cursor: pointer; transition: var(--transition);
    border: 1px solid transparent;
}
.room-card:hover { border-color: var(--primary-color); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.room-photo {
    width: 120px; height: 120px; border-radius: var(--radius-sm);
    overflow: hidden; flex-shrink: 0; background: var(--bg-tertiary);
    display: flex; align-items: center; justify-content: center;
}
.room-photo img { width: 100%; height: 100%; object-fit: cover; }
.room-photo-placeholder { color: var(--text-muted); }
.room-photo-placeholder svg { width: 48px; height: 48px; }
.room-info { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.room-number { font-size: 20px; font-weight: 600; color: var(--primary-color); }
.room-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 14px; color: var(--text-secondary); }
.room-description {
    font-size: 14px; color: var(--text-secondary); line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.room-updated { font-size: 12px; color: var(--text-muted); margin-top: auto; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state svg { width: 64px; height: 64px; margin-bottom: 16px; opacity: 0.3; }

/* Modal */
.modal {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 1000; align-items: center; justify-content: center; padding: 20px;
}
.modal.active { display: flex; }
.modal-content {
    background: var(--bg-primary); border-radius: var(--radius-lg);
    max-width: 600px; width: 100%; max-height: 90vh; overflow-y: auto;
    position: relative; animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-close {
    position: absolute; top: 16px; right: 16px; width: 32px; height: 32px;
    background: var(--bg-secondary); border: none; border-radius: 50%;
    font-size: 24px; color: var(--text-secondary); cursor: pointer;
    display: flex; align-items: center; justify-content: center; z-index: 1;
}
.modal-close:hover { background: var(--bg-tertiary); }
.modal-body { padding: 24px; }
.modal-photo { width: 100%; max-height: 300px; object-fit: cover; border-radius: var(--radius-md); margin-bottom: 20px; }
.modal-title { font-size: 24px; font-weight: 600; color: var(--primary-color); margin-bottom: 16px; }
.modal-details { display: flex; flex-direction: column; gap: 12px; }
.modal-detail { display: flex; gap: 12px; }
.modal-detail-label { font-weight: 500; color: var(--text-secondary); min-width: 140px; }
.modal-detail-value { color: var(--text-primary); word-break: break-word; }
.modal-detail-value a { color: var(--primary-color); text-decoration: none; }
.modal-detail-value a:hover { text-decoration: underline; }
.modal-description { margin-top: 20px; padding: 16px; background: var(--bg-secondary); border-radius: var(--radius-md); }
.modal-updated { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-color); font-size: 13px; color: var(--text-muted); }

/* Pagination */
.pagination {
    display: flex; justify-content: center; gap: 6px; margin-top: 24px; flex-wrap: wrap;
}
.pagination button {
    padding: 8px 14px; background: var(--bg-primary); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); font-size: 14px;
}
.pagination button:hover:not(:disabled) { border-color: var(--primary-color); color: var(--primary-color); }
.pagination button.active { background: var(--primary-color); color: white; border-color: var(--primary-color); }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Toast notifications */
.toast-container {
    position: fixed; top: 80px; right: 20px; z-index: 9999;
    display: flex; flex-direction: column; gap: 10px; max-width: 400px;
}
.toast {
    padding: 16px 20px; background: white; border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 12px;
    animation: slideInRight 0.3s ease; border-left: 4px solid;
}
.toast.success { border-left-color: #28a745; }
.toast.error { border-left-color: #dc3545; }
.toast.warning { border-left-color: #ffc107; }
.toast.info { border-left-color: var(--primary-color); }
.toast-icon { width: 24px; height: 24px; flex-shrink: 0; }
.toast.success .toast-icon { color: #28a745; }
.toast.error .toast-icon { color: #dc3545; }
.toast.warning .toast-icon { color: #ffc107; }
.toast.info .toast-icon { color: var(--primary-color); }
.toast-message { flex: 1; font-size: 14px; color: var(--text-primary); }
.toast-close {
    background: none; border: none; font-size: 20px; color: var(--text-muted);
    cursor: pointer; padding: 0; width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
}
@keyframes slideInRight { from { transform: translateX(400px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.hiding { animation: slideOutRight 0.3s ease forwards; }
@keyframes slideOutRight { to { transform: translateX(400px); opacity: 0; } }

/* Login page */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}
.login-card {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 350px;
    text-align: center;
}
.login-card h2 { margin-bottom: 8px; color: var(--text-primary); }
.login-subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }
.login-card .form-group { text-align: left; }
.login-card .btn-primary { margin-top: 8px; }

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 14px;
    text-align: left;
}
.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}
.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

/* User badge */
.user-badge {
    padding: 6px 12px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.user-badge small { opacity: 0.7; font-weight: 400; }

/* Placeholder image */
.placeholder-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--bg-tertiary);
}
.room-photo .placeholder-img {
    border-radius: var(--radius-sm);
}
.modal-photo.placeholder-img {
    border-radius: var(--radius-md);
    max-height: 300px;
}

/* Buttons (shared) */
.btn {
    padding: 10px 20px; border: none; border-radius: var(--radius-md);
    font-size: 14px; font-weight: 500; cursor: pointer; transition: var(--transition);
    display: inline-flex; justify-content: center; align-items: center; gap: 6px; text-decoration: none;
}
.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--bg-tertiary); }
.btn-danger { background: #dc3545; color: white; }
.btn-danger:hover { background: #c82333; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* Forms (shared) */
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 14px; }
.form-label.required::after { content: ' *'; color: #dc3545; }
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 10px 14px; border: 2px solid var(--border-color);
    border-radius: var(--radius-md); font-size: 15px; transition: var(--transition);
    font-family: inherit; background: var(--bg-primary); color: var(--text-primary);
}
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--primary-color); }
.form-textarea { min-height: 100px; resize: vertical; }

/* Responsive */
@media (max-width: 768px) {
    .header-content { height: auto; padding: 10px 0; }
    .logo-text { font-size: 18px; }
    .nav-btn { padding: 6px 12px; font-size: 13px; }
    .search-section { padding: 16px; }
    .filters-grid { grid-template-columns: 1fr; }
    .room-card { flex-direction: column; }
    .room-photo { width: 100%; height: 200px; }
    .modal-content { max-height: 95vh; }
    .modal-body { padding: 16px; }
    .modal-detail { flex-direction: column; gap: 4px; }
    .modal-detail-label { min-width: auto; font-size: 13px; }
    .toast-container { top: 70px; right: 10px; left: 10px; max-width: none; }
    .user-badge { font-size: 12px; padding: 4px 8px; }
}