/* Hotel Management System - Frontend Styles */

* {
    box-sizing: border-box;
}

/* RTL Support for Arabic */
body[dir="rtl"] .hms-frontend-container,
.hms-frontend-container {
    direction: rtl;
    text-align: right;
}

.hms-frontend-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Tajawal', sans-serif;
}

/* Header */
.hms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.hms-header h1 {
    margin: 0;
    font-size: 28px;
    color: #1f2937;
}

.hms-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #6b7280;
}

.hms-role-badge {
    background: #3b82f6;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Notices */
.hms-notice {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.hms-notice.hms-error {
    background: #fee2e2;
    color: #991b1b;
    border-left-color: #dc2626;
}

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

.hms-stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.hms-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.hms-stat-icon {
    font-size: 40px;
    line-height: 1;
}

.hms-stat-content h3 {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hms-stat-number {
    margin: 8px 0 0 0;
    font-size: 32px;
    font-weight: bold;
    color: #1f2937;
}

.hms-stat-active .hms-stat-number {
    color: #10b981;
}

.hms-stat-revenue .hms-stat-number {
    color: #3b82f6;
}

.hms-stat-pending .hms-stat-number {
    color: #f59e0b;
}

/* Filters Card */
.hms-filters-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.hms-filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.hms-filters input[type="text"] {
    flex: 1;
    min-width: 250px;
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.hms-filters input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.hms-filters select {
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* Buttons */
.hms-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hms-btn-primary {
    background: #3b82f6;
    color: white;
}

.hms-btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

.hms-btn-secondary {
    background: #6b7280;
    color: white;
}

.hms-btn-secondary:hover {
    background: #4b5563;
}

.hms-btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.hms-btn-edit {
    background: #f59e0b;
}

.hms-btn-edit:hover {
    background: #d97706;
}

.hms-btn-delete {
    background: #ef4444;
}

.hms-btn-delete:hover {
    background: #dc2626;
}

/* Action Bar */
.hms-action-bar {
    margin-bottom: 20px;
}

/* Table Card */
.hms-table-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.hms-table-responsive {
    overflow-x: auto;
}

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

.hms-table thead {
    background: #f9fafb;
}

.hms-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e5e7eb;
}

.hms-table td {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    color: #1f2937;
}

.hms-table tbody tr {
    transition: background-color 0.2s;
}

.hms-table tbody tr:hover {
    background: #f9fafb;
}

.hms-table tbody tr:last-child td {
    border-bottom: none;
}

/* Guest Info */
.hms-guest-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hms-guest-info strong {
    color: #1f2937;
    font-weight: 600;
}

.hms-guest-info small {
    color: #6b7280;
    font-size: 12px;
}

.hms-companions {
    color: #3b82f6 !important;
}

/* Payment Info */
.hms-payment-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hms-paid {
    color: #10b981;
    font-weight: 600;
}

.hms-total {
    color: #6b7280;
}

/* Status Badges */
.hms-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.hms-status-active {
    background: #d1fae5;
    color: #065f46;
}

.hms-status-checkedout {
    background: #e5e7eb;
    color: #4b5563;
}

/* Documents */
.hms-docs-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hms-doc-link {
    font-size: 12px;
    padding: 4px 10px;
    background: #3b82f6;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.hms-doc-link:hover {
    background: #2563eb;
    color: white;
}

.hms-no-docs {
    font-size: 12px;
    color: #9ca3af;
}

.hms-docs-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hms-doc-badge {
    font-size: 11px;
    padding: 4px 10px;
    background: #e5e7eb;
    border-radius: 6px;
    text-transform: capitalize;
    color: #4b5563;
    text-decoration: none;
    transition: background 0.2s;
}

.hms-doc-badge:hover {
    background: #d1d5db;
    color: #1f2937;
}

/* Loading and Empty States */
.hms-loading,
.hms-empty,
.hms-error {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 14px;
}

.hms-error {
    color: #dc2626;
}

/* Action Buttons */
.hms-action-buttons {
    display: flex;
    gap: 6px;
}

/* Modal */
.hms-modal {
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
}

.hms-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.hms-modal-content {
    position: relative;
    background: white;
    margin: 2% auto;
    max-width: 1100px;
    width: 90%;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.hms-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 1px solid #e5e7eb;
}

.hms-modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #1f2937;
}

.hms-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.hms-modal-close:hover {
    color: #4b5563;
}

.hms-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.hms-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 30px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 16px 16px;
}

body.hms-modal-open {
    overflow: hidden;
}

/* Form Sections */
.hms-form-section {
    margin-bottom: 30px;
}

.hms-form-section h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #1f2937;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.hms-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.hms-form-full {
    grid-column: 1 / -1;
}

.hms-form-group {
    display: flex;
    flex-direction: column;
}

.hms-form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
    font-size: 14px;
}

.hms-form-group input,
.hms-form-group select,
.hms-form-group textarea {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.hms-form-group input:focus,
.hms-form-group select:focus,
.hms-form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.required {
    color: #dc2626;
}

/* Documents Section */
.hms-documents-section {
    background: #f9fafb;
    padding: 24px;
    border-radius: 12px;
    margin-top: 30px;
}

.hms-documents-section h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #1f2937;
}

.hms-description {
    margin: 0 0 20px 0;
    color: #6b7280;
    font-size: 13px;
}

.hms-upload-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.hms-upload-box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 2px dashed #d1d5db;
}

.hms-upload-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #374151;
    font-size: 14px;
}

.hms-file-input {
    margin-bottom: 12px;
    font-size: 13px;
}

.hms-upload-status {
    margin-top: 10px;
    font-size: 13px;
}

.hms-success {
    color: #10b981;
    font-weight: 600;
}

.hms-uploading {
    color: #3b82f6;
}

/* Uploaded Documents Preview */
.hms-docs-preview {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
}

.hms-docs-preview h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #1f2937;
}

.hms-docs-list-preview {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hms-docs-list-preview li {
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.hms-docs-list-preview li:last-child {
    border-bottom: none;
}

.hms-doc-preview-link {
    color: #3b82f6;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.hms-doc-preview-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hms-upload-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hms-frontend-container {
        padding: 15px;
    }
    
    .hms-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .hms-header h1 {
        font-size: 22px;
    }
    
    .hms-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .hms-form-grid {
        grid-template-columns: 1fr;
    }
    
    .hms-filters {
        flex-direction: column;
    }
    
    .hms-filters input[type="text"] {
        min-width: 100%;
    }
    
    .hms-modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .hms-modal-body {
        padding: 20px;
    }
    
    .hms-table-responsive {
        font-size: 12px;
    }
    
    .hms-table th,
    .hms-table td {
        padding: 10px;
    }
}
