/**
 * Aspect Streaming Portal - Main Stylesheet
 * Matching Aspect Viewing Facilities branding
 */

/* Variables */
:root {
    --color-primary: #e94560;
    --color-primary-dark: #d63d56;
    --color-dark: #1a1a2e;
    --color-dark-light: #16213e;
    --color-grey-dark: #333;
    --color-grey: #666;
    --color-grey-light: #999;
    --color-border: #e0e0e0;
    --color-bg: #f5f5f5;
    --color-white: #fff;
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-danger: #dc3545;
    --color-info: #17a2b8;
    
    --font-primary: 'Helvetica Neue', Arial, sans-serif;
    --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 25px rgba(0,0,0,0.15);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

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

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

body {
    font-family: var(--font-primary);
    color: var(--color-grey-dark);
    background-color: var(--color-bg);
    line-height: 1.6;
    min-height: 100vh;
}

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

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

img {
    max-width: 100%;
    height: auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-dark);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1rem; }

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

.container-narrow {
    max-width: 600px;
}

.container-wide {
    max-width: 1400px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-dark-light) 100%);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    height: 40px;
}

.logo-text {
    color: var(--color-white);
    font-size: 1.25rem;
    font-weight: 600;
}

.logo-text span {
    color: var(--color-primary);
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav a {
    color: var(--color-white);
    font-size: 0.9rem;
    padding: 0.5rem 0;
    position: relative;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: var(--transition);
}

.nav a:hover::after,
.nav a.active::after {
    width: 100%;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-left: 1.5rem;
    border-left: 1px solid rgba(255,255,255,0.2);
}

.nav-user-name {
    color: var(--color-grey-light);
    font-size: 0.85rem;
}

/* Cards */
.card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-dark);
    margin: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

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

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

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

.btn-secondary:hover:not(:disabled) {
    background: var(--color-dark-light);
    color: var(--color-white);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-grey-dark);
}

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

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

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

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-grey-dark);
    margin-bottom: 0.5rem;
}

.form-label .required {
    color: var(--color-primary);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--color-white);
}

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

.form-control::placeholder {
    color: var(--color-grey-light);
}

.form-control:disabled {
    background: var(--color-bg);
    cursor: not-allowed;
}

select.form-control {
    cursor: pointer;
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-hint {
    font-size: 0.8rem;
    color: var(--color-grey);
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.8rem;
    color: var(--color-danger);
    margin-top: 0.25rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

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

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

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

.table th {
    background: var(--color-dark);
    color: var(--color-white);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.table th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.table tbody tr:hover {
    background: rgba(233, 69, 96, 0.03);
}

.table td {
    font-size: 0.9rem;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-confirmed {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-live {
    background: #d4edda;
    color: #155724;
    animation: pulse 2s infinite;
}

.badge-completed {
    background: #e2e3e5;
    color: #383d41;
}

.badge-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.badge-admin {
    background: var(--color-dark);
    color: var(--color-white);
}

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

.badge-pm {
    background: #6f42c1;
    color: var(--color-white);
}

.badge-viewer {
    background: #20c997;
    color: var(--color-white);
}

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

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Login Page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-dark-light) 100%);
    padding: 2rem;
}

.login-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.login-header {
    background: var(--color-dark);
    padding: 2rem;
    text-align: center;
}

.login-header h1 {
    color: var(--color-white);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--color-primary);
    font-size: 0.9rem;
    margin: 0;
}

.login-body {
    padding: 2rem;
}

.login-footer {
    text-align: center;
    padding: 1.5rem 2rem;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
}

.login-footer a {
    font-size: 0.85rem;
}

/* Dashboard */
.dashboard {
    padding: 2rem 0;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--color-primary);
}

.stat-card h3 {
    font-size: 0.85rem;
    color: var(--color-grey);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

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

/* Date/Time Session Blocks */
.session-block {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.time-slots {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.time-slot {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.time-slot input {
    width: auto;
    flex: 1;
}

.time-slot span {
    color: var(--color-grey);
}

/* Email Tags */
.email-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.email-input-wrapper input {
    flex: 1;
}

.email-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    min-height: 20px;
}

.email-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-dark-light) 100%);
    color: var(--color-white);
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    font-size: 0.85rem;
}

.email-tag button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: var(--color-white);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: var(--transition);
}

.email-tag button:hover {
    background: var(--color-danger);
}

.email-count {
    font-size: 0.8rem;
    color: var(--color-grey);
    margin-top: 0.5rem;
}

/* Stream Viewer Page */
.viewer-wrapper {
    min-height: 100vh;
    background: var(--color-dark);
}

.viewer-header {
    background: rgba(0,0,0,0.3);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.viewer-project-info h1 {
    color: var(--color-white);
    font-size: 1.25rem;
    margin: 0;
}

.viewer-project-info p {
    color: var(--color-grey-light);
    font-size: 0.85rem;
    margin: 0.25rem 0 0 0;
}

.viewer-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stream-container {
    width: 100%;
    max-width: 1200px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.stream-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Waiting Screen */
.waiting-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-dark-light) 100%);
    color: var(--color-white);
    text-align: center;
    padding: 2rem;
}

.waiting-screen .icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.waiting-screen h2 {
    color: var(--color-white);
    margin-bottom: 1rem;
}

.waiting-screen p {
    color: var(--color-grey-light);
    max-width: 400px;
}

.waiting-screen .next-session {
    margin-top: 2rem;
    padding: 1rem 2rem;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
}

.waiting-screen .next-session h3 {
    color: var(--color-primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.waiting-screen .next-session .datetime {
    color: var(--color-white);
    font-size: 1.25rem;
}

/* Files List */
.files-list {
    list-style: none;
}

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

.file-item:last-child {
    border-bottom: none;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.file-details h4 {
    font-size: 0.95rem;
    margin: 0;
}

.file-details p {
    font-size: 0.8rem;
    color: var(--color-grey);
    margin: 0.25rem 0 0 0;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: 3rem 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--color-primary);
    background: rgba(233, 69, 96, 0.03);
}

.upload-zone .icon {
    font-size: 3rem;
    color: var(--color-grey-light);
    margin-bottom: 1rem;
}

.upload-zone p {
    color: var(--color-grey);
    margin: 0;
}

.upload-zone .btn {
    margin-top: 1rem;
}

/* Progress Bar */
.progress {
    height: 8px;
    background: var(--color-bg);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar {
    height: 100%;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

/* 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: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

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

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    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(--color-grey);
}

.modal-body {
    padding: 1.5rem;
}

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

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

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

/* Responsive */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-user {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid rgba(255,255,255,0.2);
        padding-top: 1rem;
        width: 100%;
        justify-content: center;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}
