/* =============================================================================
   PROTEL TO OPERA UPLOAD TOOL - STANDALONE STYLES
   Consolidated from Operator platform base + components
   ============================================================================= */

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

/* CSS Variables */
:root {
    /* Colors */
    --bg-primary: #ebe9e6;
    --bg-workspace: #f5f4f2;
    --bg-secondary: #fafaf9;
    --bg-white: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #2d2d2d;
    --text-body: #525252;
    --text-muted: #737373;
    --border-light: #e8e7e5;
    --border-medium: #d4d3d0;
    --border-color: #e5e7eb;
    --surface-secondary: #f3f4f6;
    --primary-color: #16a34a;
    --color-primary: #16a34a;
    --color-primary-hover: #15803d;
    --color-secondary: #f59e0b;
    --color-error: #dc2626;
    --color-success: #22c55e;
    --color-info: #3b82f6;
    --color-warning: #f59e0b;
    
    /* Background colors */
    --color-error-bg: rgba(220, 38, 38, 0.1);
    --color-warning-bg: rgba(245, 158, 11, 0.1);
    --color-success-bg: rgba(34, 197, 94, 0.1);
    --color-info-bg: rgba(59, 130, 246, 0.1);
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    
    /* Typography */
    --text-xs: 12px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-lg: 16px;
    --text-xl: 20px;
    --text-2xl: 24px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    
    /* Animation */
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
}

/* Base Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--text-body);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; }
h1 { font-size: var(--text-2xl); font-weight: 700; color: var(--text-primary); }
h2 { font-size: var(--text-xl); font-weight: 600; color: var(--text-secondary); }
h3 { font-size: var(--text-lg); font-weight: 600; color: var(--text-secondary); }

/* =============================================================================
   APP LAYOUT
   ============================================================================= */

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-lg);
}

.app-header {
    background: var(--bg-white);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-md);
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-lg);
}

.header-left {
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.app-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.app-subtitle {
    color: var(--text-muted);
    font-size: var(--text-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Environment Badge */
.env-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 100px;
    vertical-align: middle;
}

.env-dev {
    background: #dbeafe;
    color: #1e40af;
}

.env-test {
    background: #fef3c7;
    color: #92400e;
}

.env-local {
    background: #f3e8ff;
    color: #6b21a8;
}

/* User Info */
.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding-right: var(--space-md);
    border-right: 1px solid var(--border-light);
}

.user-email {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.user-role {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: capitalize;
}

/* Logout Button */
.logout-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
}

.logout-btn:hover {
    color: var(--color-error);
    border-color: var(--color-error);
    background: var(--color-error-bg);
}

.logout-btn svg {
    flex-shrink: 0;
}

/* Responsive Header */
@media (max-width: 768px) {
    .header-main {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .user-info {
        align-items: flex-start;
        padding-right: 0;
        border-right: none;
    }
}

.app-footer {
    margin-top: var(--space-xl);
    padding: var(--space-lg);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

/* =============================================================================
   TAB NAVIGATION
   ============================================================================= */

.tab-navigation {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    background: var(--bg-white);
    padding: var(--space-xs);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.tab-button {
    flex: 1;
    padding: 10px var(--space-md);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.tab-button:hover {
    background: var(--bg-secondary);
    color: var(--text-body);
}

.tab-button.active {
    background: var(--color-primary);
    color: white;
}

.tab-content-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
}

/* =============================================================================
   BUTTONS
   ============================================================================= */

button {
    font-family: inherit;
    font-size: var(--text-base);
    cursor: pointer;
    border: none;
    border-radius: var(--radius-md);
    transition: all 0.2s var(--ease-out);
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    padding: var(--space-sm) var(--space-lg);
    font-weight: 500;
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-hover);
}

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

/* Icon-only button variant */
.btn-icon-only {
    padding: var(--space-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-body);
    padding: var(--space-sm) var(--space-lg);
    font-weight: 500;
}

.btn-secondary:hover {
    background: var(--border-light);
}

.btn-danger {
    background: var(--color-error);
    color: white;
    padding: var(--space-sm) var(--space-lg);
    font-weight: 500;
}

.icon-action {
    background: transparent;
    padding: var(--space-xs);
    color: var(--text-muted);
}

.icon-action:hover {
    background: var(--bg-secondary);
    color: var(--text-body);
}

/* =============================================================================
   FORMS
   ============================================================================= */

.user-form {
    max-width: 100%;
}

.form-section {
    margin-bottom: 20px;
}

.form-section h3 {
    margin-bottom: var(--space-sm);
}

.section-description {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin-bottom: var(--space-md);
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    font-size: var(--text-sm);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-group small {
    display: block;
    color: var(--text-muted);
    font-size: var(--text-xs);
    margin-top: var(--space-xs);
}

.form-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

/* =============================================================================
   PANELS & SECTIONS
   ============================================================================= */

.dashboard-section {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--bg-white);
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-white);
}

.hotel-panel-header {
    padding: var(--space-md);
}

.section-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: var(--text-sm);
    margin-top: 4px;
    margin-bottom: 0;
    line-height: 1.4;
}

.section-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.section-content {
    padding: var(--space-md);
}

.section-filters {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-sm);
    cursor: pointer;
}

/* =============================================================================
   TWO-PANEL LAYOUT
   ============================================================================= */

.two-panel-layout {
    display: flex;
    gap: var(--space-lg);
    flex: 1;
}

.two-panel-layout > .dashboard-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.two-panel-layout .section-content {
    flex: 1;
    overflow-y: auto;
}

/* =============================================================================
   EXPANDABLE LIST
   ============================================================================= */

.expandable-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.expandable-item {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    transition: border-color 0.2s, background-color 0.2s;
}

.expandable-item.selected {
    border-color: var(--primary);
    background: var(--primary-lightest, #f0f7ff);
}

.expandable-header {
    display: flex;
    align-items: center;
    padding: 10px var(--space-md);
    gap: var(--space-sm);
}

.header-content {
    flex: 1;
    min-width: 0;
}

.expand-toggle {
    background: none;
    border: none;
    padding: var(--space-xs);
    cursor: pointer;
    color: var(--text-muted);
}

.expand-icon {
    transition: transform 0.2s;
}

/* CSS-only expansion: rotate chevron when parent has .expanded class */
.expandable-item.expanded .expand-icon {
    transform: rotate(180deg);
}

.item-details {
    /* Hidden by default - CSS-only expansion */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 var(--space-md);
    color: var(--text-body);
    font-size: var(--text-sm);
    transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
}

/* Show details when parent item is expanded */
.expandable-item.expanded .item-details {
    max-height: 2000px; /* Large enough for any content */
    opacity: 1;
    padding: 0 var(--space-md) 10px var(--space-md);
}

.item-checkbox {
    cursor: pointer;
    width: 18px;
    height: 18px;
    margin-right: var(--space-xs);
    flex-shrink: 0;
}

.header-content {
    cursor: default;
}

.expand-toggle:hover {
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
}

.employee-header-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.reservation-header-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-sm);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.employee-name {
    font-weight: 600;
    color: var(--text-primary);
}

.employee-meta {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* =============================================================================
   FILE DROP ZONE
   ============================================================================= */

.csv-import-area {
    padding: var(--space-lg);
}

.file-dropzone {
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    transition: all 0.2s;
}

.file-dropzone.dragover {
    border-color: var(--color-primary);
    background: rgba(22, 163, 74, 0.05);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.dropzone-content svg {
    color: var(--text-muted);
}

.dropzone-content h3 {
    color: var(--text-secondary);
}

.dropzone-content p {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

/* =============================================================================
   PARSED FILE INFO
   ============================================================================= */

.parsed-file-info {
    background: var(--bg-secondary);
    padding: 12px var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

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

.info-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.info-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.info-value {
    font-size: var(--text-base);
    color: var(--text-primary);
    font-weight: 500;
}

/* =============================================================================
   STATUS BADGES
   ============================================================================= */

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.status-success { background: #dcfce7; color: #15803d; }
.status-badge.status-info { background: #dbeafe; color: #1e40af; }
.status-badge.status-warning { background: #fef3c7; color: #d97706; }
.status-badge.status-error { background: #fee2e2; color: #dc2626; }

/* =============================================================================
   DATA TABLE
   ============================================================================= */

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

.data-table thead {
    background: var(--bg-secondary);
}

.data-table th {
    text-align: left;
    padding: var(--space-sm) var(--space-md);
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.data-table td {
    padding: var(--space-sm) var(--space-md);
    border-top: 1px solid var(--border-light);
}

/* =============================================================================
   EMPTY STATE
   ============================================================================= */

.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.empty-state p {
    font-size: var(--text-sm);
}

/* =============================================================================
   STATUS MESSAGE
   ============================================================================= */

.status-message {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
}

.status-message.success {
    background: #dcfce7;
    color: #15803d;
}

/* =============================================================================
   MODAL
   ============================================================================= */

.modal-overlay {
    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: 9999;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
}

.modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
}

.modal-footer-right {
    display: flex;
    gap: var(--space-sm);
}

/* =============================================================================
   LOADING
   ============================================================================= */

.loading-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    color: var(--text-muted);
}

/* =============================================================================
   RESERVATION DETAILS
   ============================================================================= */

.reservation-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-section-title {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--border-light);
}

.detail-row {
    font-size: var(--text-sm);
    color: var(--text-body);
    padding: 4px 0;
}

.detail-row strong {
    color: var(--text-secondary);
    font-weight: 600;
    display: inline-block;
    min-width: 140px;
}

.detail-row-full {
    font-size: var(--text-sm);
    color: var(--text-body);
    line-height: 1.6;
}

.text-muted {
    color: var(--text-muted);
    font-style: italic;
}

.text-success {
    color: var(--color-success);
}

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

.badge-success, .badge-warning, .badge-error, .badge-info {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success {
    background: #dcfce7;
    color: #15803d;
}

.badge-warning {
    background: #fef3c7;
    color: #a16207;
}

.badge-error {
    background: #fee2e2;
    color: #b91c1c;
}

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

/* =============================================================================
   CONNECTION STATUS PANEL
   ============================================================================= */

.connection-status-panel {
    padding: var(--space-lg);
}

.status-section {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
}

.status-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.status-section h3 {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-label {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-value {
    font-size: var(--text-sm);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-value.monospace {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    word-break: break-all;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 100px;
    background: var(--surface-secondary);
    text-transform: capitalize;
}

.status-badge.env-dev {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.env-test {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.env-local {
    background: #f3e8ff;
    color: #6b21a8;
}

.status-badge.env-prod {
    background: #dcfce7;
    color: #166534;
}

.info-box {
    padding: var(--space-md);
    background: var(--color-info-bg);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-body);
}

.info-box ul {
    list-style: disc;
}

.info-box li {
    margin-bottom: 4px;
}

.info-box li:last-child {
    margin-bottom: 0;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 768px) {
    .two-panel-layout {
        grid-template-columns: 1fr;
    }
    
    .app-container {
        padding: var(--space-md);
    }
    
    .tab-navigation {
        flex-direction: column;
    }
}

