/**
 * Meetzo - Modern Video Chat Styles
 * Light Theme Only - Compact & Vibrant
 */

/* ================================
   CSS Custom Properties (Light Theme Enforced)
   ================================ */
:root {
    /* Light Theme Palette */
    --bg-primary: #f0f2f5;
    /* Lighter, softer background */
    --bg-secondary: #ffffff;
    /* Pure white cards */
    --bg-tertiary: #f8f9fa;
    /* Slightly off-white for contrast */
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.7);

    --border-color: #e4e6eb;
    --border-glow: rgba(99, 102, 241, 0.4);

    --text-primary: #1c1e21;
    --text-secondary: #65676b;
    --text-muted: #8a8d91;

    /* Vibrant Gradients */
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --accent-gradient-hover: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 15px rgba(99, 102, 241, 0.2);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================================
   Base Styles & Reset
   ================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    /* Reduced base size */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    /* Dynamic viewport height for mobile */
    overflow-x: hidden;
    line-height: 1.5;
}

/* ================================
   App Container
   ================================ */
.app-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    max-width: 1400px;
    /* Constrained max width */
    margin: 0 auto;
    padding: 12px;
}

/* ================================
   Header
   ================================ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon-bg {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
}

.logo-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

.logo h1 {
    font-size: 1.25rem;
    /* Smaller title */
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo .highlight {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Profile Compact Styles */
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    /* Pill shape */
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.user-profile:hover {
    box-shadow: var(--shadow-md);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-tertiary);
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    max-width: 120px;
    color: var(--text-primary);
}

.icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    /* Circular */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.icon-btn:hover {
    background: #fee2e2;
    color: var(--danger);
}


.icon-btn .icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ================================
   Main Content Layout
   ================================ */
.main-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 340px;
    /* Reduced chat width */
    gap: 12px;
    min-height: 0;
}

/* ================================
   Video Section
   ================================ */
.video-section {
    position: relative;
    display: flex;
    flex-direction: column;
}

.video-container {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.remote-video-container {
    flex: 1;
    min-height: 350px;
}

.video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    /* Video background always black */
}

/* Placeholder Styling */
.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
}

/* Placeholders */
.chat-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 40px;
}

.welcome-icon {
    margin-bottom: 8px;
    color: var(--accent-primary);
    background: var(--bg-tertiary);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

.icon-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 16px;
}

.icon-circle.large {
    width: 80px;
    height: 80px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.placeholder-icon {
    color: var(--text-muted);
    width: 40px;
    height: 40px;
}

.local-placeholder .placeholder-icon.small {
    width: 24px;
    height: 24px;
}

.video-placeholder p {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Local Video (PiP) */
.local-video-container {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 160px;
    /* Smaller PiP */
    height: 120px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 2px solid white;
    z-index: 10;
    background: #000;
}

.local-controls {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.5);
    /* Semi-transparent dark pill */
    padding: 4px;
    border-radius: 20px;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.local-video-container:hover .local-controls {
    opacity: 1;
}

.control-btn.small {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.control-btn.small:hover {
    background: rgba(255, 255, 255, 0.2);
}

.control-btn.small .icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ================================
   Chat Section
   ================================ */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.chat-header {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-tertiary);
}

.chat-header h2 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.chat-status {
    font-size: 0.7rem;
    color: var(--text-secondary);
    padding: 2px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-secondary);
}

.message {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.message.sent {
    align-self: flex-end;
    background: var(--accent-gradient);
    color: white;
    border-bottom-right-radius: 2px;
    box-shadow: var(--shadow-sm);
}

.message.received {
    align-self: flex-start;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 2px;
}

.message.system {
    align-self: center;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
}

.chat-input-container {
    padding: 10px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: all 0.2s;
}

.chat-input:focus {
    outline: none;
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.send-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--accent-gradient);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    box-shadow: var(--shadow-md);
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    background: var(--accent-gradient-hover);
}

.send-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
    margin-left: 2px;
    /* Visual balance */
}

/* ================================
   Control Bar
   ================================ */
.control-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    margin-top: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

/* New Icons for Buttons via CSS Masks or SVG fills managed in HTML */
.action-btn svg {
    width: 20px;
    height: 20px;
}

.action-btn.primary {
    background: var(--accent-gradient);
    color: white;
}

.action-btn.primary:hover:not(:disabled) {
    background: var(--accent-gradient-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.action-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.action-btn.secondary:hover:not(:disabled) {
    background: #e0e7ff;
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.action-btn.danger {
    background: #fee2e2;
    color: var(--danger);
    border: 1px solid transparent;
}

.action-btn.danger:hover:not(:disabled) {
    background: var(--danger);
    color: white;
}

/* ================================
   Toast
   ================================ */
.toast-container {
    bottom: 80px;
    right: 20px;
}

.toast {
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    font-size: 0.85rem;
    font-weight: 500;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

/* ================================
   Responsive
   ================================ */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
        gap: 8px;
    }

    .chat-section {
        height: 35vh;
        /* Proportional height */
        min-height: 200px;
    }

    .remote-video-container {
        min-height: 0;
        /* Allow shrinking */
    }

    .header {
        padding: 8px 12px;
        margin-bottom: 8px;
    }

    .logo h1 {
        font-size: 1.1rem;
    }

    .action-btn {
        padding: 12px;
        /* larger touch target */
    }

    .action-btn span {
        display: none;
    }

    /* Mobile PiP */
    .local-video-container {
        width: 100px;
        height: 133px;
        /* 3:4 aspect ratio */
        bottom: 12px;
        right: 12px;
        border-width: 1.5px;
    }

    .local-controls {
        opacity: 1;
        /* Always show controls on mobile */
        padding: 6px;
    }

    .control-btn.small {
        width: 32px;
        /* larger touch target */
        height: 32px;
        background: rgba(0, 0, 0, 0.4);
        /* clearer background */
    }

    .logo-icon-bg {
        width: 32px;
        height: 32px;
    }

    .logo-icon {
        width: 18px;
        height: 18px;
    }
}

/* Footer Links */
.footer-links {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    font-size: 0.85rem;
    padding-bottom: 20px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border-top: 1px solid var(--border-color);
    transform: translateY(100%);
    animation: slideUp 0.5s forwards;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
    }
}

.cookie-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cookie-content p {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin: 0;
}

.cookie-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cookie-link {
    font-size: 0.9rem;
    color: var(--accent-primary);
    text-decoration: none;
}

.cookie-btn {
    background: var(--text-primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

@media (max-width: 600px) {
    .cookie-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-actions {
        width: 100%;
        justify-content: space-between;
    }
}