/**
 * Laniken CallREC Cloud - Styles
 * 
 * Design System:
 * - Background: #121214 (dark)
 * - Cards: #1a1a1e / #252528
 * - Accent: #FF5F00 (Laniken Orange)
 * - Text: #FFFFFF, #A1A1AA
 * - Borders: #3f3f46
 * - Font: Inter
 * - Corners: 4-6px (rectilinear)
 */

/* ============================
   CSS Variables & Reset
   ============================ */
:root {
    --bg-primary: #121214;
    --bg-secondary: rgba(255, 255, 255, 0.03);
    --bg-gradient: linear-gradient(135deg, #121214 0%, #1a1a1e 100%);
    --bg-tertiary: rgba(255, 255, 255, 0.05);
    --accent: #FF5F00;
    --accent-gradient: linear-gradient(135deg, #FF5F00 0%, #ff7a2e 100%);
    --accent-hover: #e55500;
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.5);
    --text-muted: rgba(255, 255, 255, 0.3);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.05);
    --success: #4ade80;
    --error: #f87171;
    --warning: #f59e0b;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --transition: 200ms ease-in-out;
    --header-height: 72px;
    --shadow-accent: 0 4px 12px rgba(255, 95, 0, 0.3);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

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

a:hover {
    color: #fff;
}

/* ============================
   Dev Banner
   ============================ */
.dev-banner {
    background-color: var(--warning);
    color: #000;
    padding: 8px 16px;
    font-size: 0.875rem;
    text-align: center;
    position: relative;
    z-index: 1100;
}

/* ============================
   Header
   ============================ */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(135deg, rgba(255, 95, 0, 0.15) 0%, rgba(255, 95, 0, 0.05) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 95, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left .header-logo {
    height: 40px;
    width: auto;
    border-radius: 8px;
}

.header-title-box {
    display: flex;
    flex-direction: column;
}

.header-brand {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.header-brand .brand-orange {
    color: var(--accent);
}

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

.header-nav {
    display: flex;
    gap: 8px;
}

.header-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
}

.header-nav a:hover {
    color: #fff;
    background-color: var(--bg-tertiary);
}

.header-nav a.active {
    color: #fff;
    background-color: rgba(255, 95, 0, 0.2);
    border: 1px solid rgba(255, 95, 0, 0.2);
}

.header-right {
    display: flex;
    align-items: center;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

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

/* ============================
   Main Content
   ============================ */
.main-content {
    padding-top: calc(var(--header-height) + 40px);
    padding-left: 32px;
    padding-right: 32px;
    padding-bottom: 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.main-content.full-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height));
    padding-top: 0;
}

.setup-logo {
    height: 48px;
    width: auto;
    margin: 0 auto;
}

.login-logo {
    height: 54px;
    width: auto;
    margin: 0 auto 16px auto;
    display: block;
}

/* ============================
   Cards & Panels
   ============================ */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
}

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

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-title .material-symbols-outlined {
    color: var(--accent);
}

/* ============================
   Buttons
   ============================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 95, 0, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 95, 0, 0.3);
    color: #fff;
}

.btn-icon {
    padding: 10px;
}

/* ============================
   Form Elements
   ============================ */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.label-hint {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 4px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    color: #fff;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all var(--transition);
}

.form-input:focus {
    border-color: rgba(255, 95, 0, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

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

/* ============================
   Login Page
   ============================ */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-box {
    width: 100%;
    max-width: 400px;
}

.login-box .logo {
    display: block;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-box .tagline {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.login-box .btn-primary {
    width: 100%;
}

/* ============================
   Dashboard - Recordings List
   ============================ */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.dashboard-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    min-width: 300px;
}

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.search-bar .material-symbols-rounded {
    color: var(--text-muted);
}

.recordings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recording-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
}

.recording-item:hover {
    border-color: var(--border-color);
    transform: translateY(-1px);
}

.recording-item.active {
    border-color: var(--accent);
    background-color: rgba(255, 95, 0, 0.05);
}

.recording-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--accent);
}

.recording-info {
    flex: 1;
    min-width: 0;
}

.recording-title {
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recording-meta {
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.recording-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.recording-actions {
    display: flex;
    gap: 8px;
}

/* ============================
   Recording Detail / Player
   ============================ */
.recording-detail {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
}

@media (max-width: 1024px) {
    .recording-detail {
        grid-template-columns: 1fr;
    }
}

.player-section {
    margin-bottom: 24px;
}

.waveform-container {
    height: 80px;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    overflow: hidden;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.play-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition);
}

.play-btn:hover {
    background-color: var(--accent-hover);
    transform: scale(1.05);
}

.time-display {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.transcript-section {
    max-height: 500px;
    overflow-y: auto;
}

.transcript-line {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.transcript-line:last-child {
    border-bottom: none;
}

.speaker-label {
    display: inline-block;
    font-weight: 600;
    color: var(--accent);
    margin-right: 8px;
}

/* ============================
   Speaker Mapping Panel
   ============================ */
.speaker-mapping {
    position: sticky;
    top: calc(var(--header-height) + 24px);
}

.speaker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.speaker-original {
    min-width: 100px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.speaker-input {
    flex: 1;
}

/* ============================
   Toast Notifications
   ============================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--error);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================
   Empty State
   ============================ */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-secondary);
}

.empty-state .material-symbols-rounded {
    font-size: 64px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* ============================
   Utilities
   ============================ */
.text-muted {
    color: var(--text-secondary);
}

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

.mt-4 {
    margin-top: 16px;
}

.mb-4 {
    margin-bottom: 16px;
}

/* ============================
   Scrollbar
   ============================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}