/* OttoVoice Dashboard - Green Theme */

:root {
    --primary: #00ff87;
    --primary-dim: rgba(0, 255, 135, 0.3);
    --secondary: #00d4ff;
    --dark: #0a0a0f;
    --darker: #050508;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.6);
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --success: #00ff87;
    --warning: #ffbb00;
    --danger: #ff4444;
}

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

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

html {
    scroll-behavior: smooth;
}

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

/* Page transition animation */
.main-content {
    animation: fadeIn 0.3s ease;
}

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

/* Auth Pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: var(--darker);
    position: relative;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(0, 255, 135, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 135, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 50px;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    text-decoration: none;
}

.auth-logo img {
    height: 40px;
}

.auth-logo span {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
}

.auth-logo span em {
    font-style: normal;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-card h1 {
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-dim);
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dim);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    background: rgba(10, 10, 15, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(10, 10, 15, 0.9);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(10, 10, 15, 1);
    box-shadow: 0 0 0 3px var(--primary-dim), 0 0 20px var(--primary-dim);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Select dropdown styling */
.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23ffffff60' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
}

.form-group select option {
    background: var(--dark);
    color: var(--text);
    padding: 12px;
}

/* Input with icon */
.input-with-icon {
    position: relative;
}

.input-with-icon input {
    padding-left: 48px;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    opacity: 0.5;
}

/* Global input styling (for inputs outside form-groups) */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="url"],
select,
textarea {
    background: rgba(10, 10, 15, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    padding: 12px 16px;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="tel"]:hover,
input[type="number"]:hover,
input[type="date"]:hover,
input[type="time"]:hover,
input[type="url"]:hover,
select:hover,
textarea:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(10, 10, 15, 0.9);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(10, 10, 15, 1);
    box-shadow: 0 0 0 3px var(--primary-dim), 0 0 20px var(--primary-dim);
}

/* Toggle Switch styling */
.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--gradient);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-primary {
    background: var(--gradient);
    color: #000;
    width: 100%;
    box-shadow: 0 0 30px var(--primary-dim);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px var(--primary-dim);
}

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

.btn-secondary:hover {
    border-color: var(--primary);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-dim);
    font-size: 0.95rem;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--dark);
    border-right: 1px solid var(--card-border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    margin-bottom: 40px;
}

.sidebar-logo img {
    height: 32px;
}

.sidebar-logo span {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
}

.sidebar-logo span em {
    font-style: normal;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

/* Sidebar scrollbar - extra subtle */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dim);
}

.nav-section {
    margin-bottom: 32px;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 12px;
    padding-left: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.nav-item:hover {
    background: var(--card-bg);
    color: var(--text);
}

.nav-item.active {
    background: var(--primary-dim);
    color: var(--primary);
}

.nav-item .icon {
    font-size: 1.2rem;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.sidebar-footer {
    padding-top: 24px;
    border-top: 1px solid var(--card-border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    background: var(--card-bg);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #000;
}

.user-details {
    flex: 1;
}

.user-details .name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-details .plan {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 800;
}

.top-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
}

.stat-card .label {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 800;
}

.stat-card .change {
    font-size: 0.85rem;
    margin-top: 8px;
}

.stat-card .change.positive {
    color: var(--success);
}

.stat-card .change.negative {
    color: var(--danger);
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
}

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

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

table th,
table td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--card-border);
}

table th {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(0, 255, 135, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(255, 187, 0, 0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(255, 68, 68, 0.1);
    color: var(--danger);
}

.badge-neutral {
    background: var(--card-bg);
    color: var(--text-dim);
}

/* Minutes Usage */
.minutes-bar {
    background: var(--dark);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0;
}

.minutes-bar-fill {
    height: 100%;
    background: var(--gradient);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.minutes-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-dim);
}

/* Calendar */
.calendar {
    background: var(--dark);
    border-radius: 12px;
    overflow: hidden;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--card-bg);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day-name {
    padding: 12px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
    border-bottom: 1px solid var(--card-border);
}

.calendar-day {
    padding: 12px;
    min-height: 100px;
    border: 1px solid var(--card-border);
    border-top: none;
    border-left: none;
}

.calendar-day:nth-child(7n + 1) {
    border-left: 1px solid var(--card-border);
}

.calendar-day .date {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.calendar-day.today .date {
    background: var(--gradient);
    color: #000;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-event {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
    background: var(--primary-dim);
    color: var(--primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Chat Interface */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 500px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-message {
    max-width: 80%;
    padding: 16px 20px;
    border-radius: 16px;
    line-height: 1.6;
}

.chat-message.ai {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-message.user {
    background: var(--gradient);
    color: #000;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-input-container {
    display: flex;
    gap: 12px;
    padding: 20px;
    background: var(--dark);
    border-top: 1px solid var(--card-border);
}

.chat-input {
    flex: 1;
    padding: 16px 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    resize: none;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-dim);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

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

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: var(--dark);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-title {
    font-size: 1.3rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 24px;
    border-top: 1px solid var(--card-border);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 101;
    width: 44px;
    height: 44px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 80px 16px 24px;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .top-actions {
        width: 100%;
    }

    .top-actions .btn {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 16px;
    }

    .page-title {
        font-size: 1.4rem;
    }

    table {
        font-size: 0.85rem;
    }

    table th,
    table td {
        padding: 10px 8px;
    }
}
