/* 
 * NexaMeet Pro - Unified Design System
 * Professional styling inspired by Stripe, GitHub, and Linear
 */

:root {
    /* Primary Color Palette - Professional Blue */
    --primary: #0969da;
    --primary-hover: #0860ca;
    --primary-light: #218bff;
    --primary-dark: #0550ae;
    
    /* Semantic Colors */
    --success: #1a7f37;
    --success-light: #2da44e;
    --danger: #cf222e;
    --danger-light: #da3633;
    --warning: #bf8700;
    --warning-light: #d1a01f;
    --info: #0969da;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f6f9fc;
    --bg-tertiary: #eef2f7;
    --bg-quaternary: #d0d7de;
    
    /* Text Colors */
    --text-primary: #0d1117;
    --text-secondary: #656d76;
    --text-tertiary: #8b949e;
    --text-quaternary: #a5a5a5;
    --text-inverse: #ffffff;
    
    /* Border Colors */
    --border-primary: #e1e5e9;
    --border-secondary: #d0d7de;
    --border-tertiary: #afb8c1;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-xl: 0 16px 32px rgba(0,0,0,0.16);
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography Scale */
.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-base { font-size: 16px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 30px; }
.text-4xl { font-size: 36px; }
.text-5xl { font-size: 48px; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Layout Components */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-sm {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Button System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 10px var(--space-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    user-select: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
    border: 1px solid var(--primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: var(--border-secondary);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: var(--text-inverse);
    border: 1px solid var(--success);
}

.btn-success:hover:not(:disabled) {
    background: var(--success-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-inverse);
    border: 1px solid var(--danger);
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-sm {
    padding: 6px var(--space-md);
    font-size: 12px;
}

.btn-lg {
    padding: 14px var(--space-xl);
    font-size: 16px;
}

/* Form Components */
.form-group {
    margin-bottom: var(--space-lg);
}

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

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-size: 16px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-normal);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: var(--space-xs);
}

/* Card Components */
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
}

.card-header {
    margin-bottom: var(--space-lg);
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Alert Components */
.alert {
    padding: 12px var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.alert-success {
    background: #dcfce7;
    color: var(--success);
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: var(--warning);
    border: 1px solid #fed7aa;
}

.alert-info {
    background: #dbeafe;
    color: var(--info);
    border: 1px solid #bfdbfe;
}

/* Status Indicators */
.status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 4px var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
}

.status-success {
    background: #dcfce7;
    color: var(--success);
}

.status-error {
    background: #fef2f2;
    color: var(--danger);
}

.status-warning {
    background: #fef3c7;
    color: var(--warning);
}

.status-info {
    background: #dbeafe;
    color: var(--info);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.status-indicator.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Loading Components */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-primary);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header Component */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    padding: var(--space-md) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.logo-icon {
    font-size: 24px;
}

/* Navigation */
.nav {
    display: flex;
    gap: var(--space-xl);
    list-style: none;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color var(--transition-normal);
    position: relative;
}

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

.nav-link.active {
    color: var(--primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
}

/* Modal System */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95) translateY(20px);
    opacity: 0;
    transition: all var(--transition-slow);
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-header {
    background: var(--bg-secondary);
    padding: var(--space-2xl) var(--space-xl) var(--space-lg);
    text-align: center;
    border-bottom: 1px solid var(--border-primary);
    position: relative;
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-icon {
    width: 64px;
    height: 64px;
    background: #f0f9ff;
    color: var(--primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto var(--space-md);
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.modal-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

.modal-body {
    padding: var(--space-xl);
}

/* Notification System */
.notification {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    min-width: 300px;
    max-width: 400px;
    transform: translateX(400px);
    transition: transform var(--transition-slow);
}

.notification.show {
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.notification-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.success .notification-icon {
    background: #dcfce7;
    color: var(--success);
}

.notification.error {
    border-left: 4px solid var(--danger);
}

.notification.error .notification-icon {
    background: #fef2f2;
    color: var(--danger);
}

.notification.warning {
    border-left: 4px solid var(--warning);
}

.notification.warning .notification-icon {
    background: #fef3c7;
    color: var(--warning);
}

.notification-text {
    flex: 1;
}

.notification-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.notification-message {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }
.mb-5 { margin-bottom: var(--space-xl); }
.mb-6 { margin-bottom: var(--space-2xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.mt-5 { margin-top: var(--space-xl); }
.mt-6 { margin-top: var(--space-2xl); }

.p-0 { padding: 0; }
.p-1 { padding: var(--space-xs); }
.p-2 { padding: var(--space-sm); }
.p-3 { padding: var(--space-md); }
.p-4 { padding: var(--space-lg); }
.p-5 { padding: var(--space-xl); }
.p-6 { padding: var(--space-2xl); }

.hidden { display: none; }
.visible { display: block; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-xs); }
.gap-2 { gap: var(--space-sm); }
.gap-3 { gap: var(--space-md); }
.gap-4 { gap: var(--space-lg); }

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-md);
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .modal-header,
    .modal-body {
        padding: var(--space-lg);
    }
    
    .nav {
        display: none; /* Hide nav on mobile, add hamburger menu if needed */
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Dark Theme Support (for room.php) */
@media (prefers-color-scheme: dark) {
    .theme-dark {
        --bg-primary: #0d1117;
        --bg-secondary: #161b22;
        --bg-tertiary: #21262d;
        --text-primary: #f0f6fc;
        --text-secondary: #8b949e;
        --text-tertiary: #6e7681;
        --border-primary: #30363d;
        --border-secondary: #21262d;
    }
}

/* Animation Library */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.animate-fadeIn { animation: fadeIn 0.5s ease-out; }
.animate-fadeInUp { animation: fadeInUp 0.5s ease-out; }
.animate-fadeInDown { animation: fadeInDown 0.5s ease-out; }

/* Focus Management */
.focus-outline:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
}
