@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --vizeo-dark: #10152b;
    --vizeo-primary: #19203b;
    --vizeo-light: #2a3454;
    --vizeo-accent: #3d4a6e;
    --vizeo-red: #f24c52;
    --vizeo-red-dark: #d93a40;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

body,
html {
    font-family: 'Inter', sans-serif;
    background-color: var(--vizeo-dark);
    margin: 0;
    padding: 0;
    height: 100%;
    color: var(--gray-700);
    -webkit-font-smoothing: antialiased;
}

/* Utilities */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.center {
    justify-content: center;
    align-items: center;
}

.column {
    flex-direction: column;
}

.w-full {
    width: 100%;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* Auth / Landing Page */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--vizeo-dark);
    background-image: radial-gradient(var(--vizeo-light) 1px, transparent 1px);
    background-size: 40px 40px;
}

.auth-card {
    background-color: var(--white);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
    min-height: 450px;
    /* Ensure consistent height during loading */
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.logo-area {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-area img {
    height: 60px;
    margin-bottom: 1rem;
}

.logo-area h4 {
    margin: 0;
    color: var(--vizeo-dark);
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-area p {
    margin: 0.5rem 0 0;
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Tabs */
.tabs {
    display: flex;
    background-color: var(--gray-100);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--gray-500);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background-color: var(--vizeo-dark);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

/* Tab Loader */
.tab-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    flex-direction: column;
    gap: 15px;
    color: var(--vizeo-primary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--vizeo-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    color: var(--gray-800);
    font-size: 0.95rem;
    transition: all 0.2s;
    box-sizing: border-box;
    outline: none;
}

input:focus {
    background-color: var(--white);
    border-color: var(--vizeo-accent);
    box-shadow: 0 0 0 3px rgba(61, 74, 110, 0.1);
}

.btn {
    width: 100%;
    padding: 14px;
    background-color: var(--vizeo-red);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background-color: var(--vizeo-red-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--gray-100);
    color: var(--gray-700);
    margin-top: 1rem;
}

.btn-secondary:hover {
    background-color: var(--gray-200);
}

.message {
    margin-top: 1rem;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.875rem;
    text-align: center;
}

.message.error {
    background-color: #fee2e2;
    color: #991b1b;
}

.message.success {
    background-color: #dcfce7;
    color: #166534;
}

/* Dashboard */
.dashboard-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: var(--gray-50);
}

.top-header {
    height: 70px;
    background-color: var(--vizeo-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: var(--shadow);
    z-index: 20;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    height: 32px;
}

.header-title {
    color: var(--white);
    font-weight: 600;
    font-size: 1.1rem;
}

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

.nav-item {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn-red {
    background-color: var(--vizeo-red);
    color: var(--white);
}

.nav-btn-red:hover {
    background-color: var(--vizeo-red-dark);
}

.nav-btn-light {
    background-color: var(--white);
    color: var(--vizeo-dark);
}

.nav-btn-light:hover {
    background-color: var(--gray-100);
}

.nav-btn-ghost {
    color: var(--gray-400);
    background: rgba(255, 255, 255, 0.05);
}

.nav-btn-ghost:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

/* Device Bar */
.device-bar {
    background-color: var(--white);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--gray-200);
    overflow-x: auto;
}

.device-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.device-chip:hover {
    border-color: var(--gray-400);
    background-color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.device-chip.active {
    background-color: var(--vizeo-primary);
    color: var(--white);
    border-color: var(--vizeo-primary);
}

.device-chip .delete-icon {
    opacity: 0.5;
    padding: 2px;
    border-radius: 50%;
    transition: all 0.2s;
}

.device-chip .delete-icon:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.2);
}

.add-device-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background-color: var(--vizeo-red);
    color: var(--white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.add-device-btn:hover {
    background-color: var(--vizeo-red-dark);
    transform: scale(1.05);
}

/* Main Content */
.main-content {
    flex: 1;
    position: relative;
    background-color: var(--gray-100);
    overflow: hidden;
}

.iframe-container {
    width: 100%;
    height: 100%;
    background: #000;
}

.placeholder-state {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--gray-300);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(16, 21, 43, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-box {
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-xl);
    transform: scale(1);
    animation: scaleIn 0.2s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
    }

    to {
        transform: scale(1);
    }
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--vizeo-dark);
}

.close-modal {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.2s;
}

.close-modal:hover {
    background: var(--gray-200);
    color: var(--vizeo-red);
}