:root {
    --primary: #4285f4;
    --primary-dark: #3367d6;
    --secondary: #5f6368;
    --success: #34a853;
    --warning: #fbbc04;
    --danger: #ea4335;
    --bg-dark: #1a1a2e;
    --bg-sidebar: #16213e;
    --bg-content: #f5f5f5;
    --bg-card: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #5f6368;
    --text-light: #ffffff;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

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

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

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-sidebar) 100%);
}

.login-container {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.8rem;
    color: var(--bg-dark);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

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

.login-form .btn {
    width: 100%;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    background: var(--bg-sidebar);
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar .logo {
    padding: 0 1.5rem;
    margin-bottom: 2rem;
}

.sidebar .logo h2 {
    color: var(--text-light);
    font-size: 1.3rem;
}

.nav-links {
    list-style: none;
    flex: 1;
}

.nav-links li a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-links li a:hover,
.nav-links li a.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border-left: 3px solid var(--primary);
}

.nav-footer {
    padding: 0 1.5rem;
}

.logout-btn {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--danger);
    text-decoration: none;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.logout-btn:hover {
    background: rgba(234, 67, 53, 0.1);
}

/* Main Content */
.content {
    margin-left: 250px;
    padding: 2rem;
    min-height: 100vh;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-secondary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 2rem;
}

.stat-info h3 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.status-enabled {
    color: var(--success);
}

/* Quick Actions */
.quick-actions {
    margin-bottom: 3rem;
}

.quick-actions h2 {
    margin-bottom: 1.5rem;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.action-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.action-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}

.action-card h3 {
    margin-bottom: 0.5rem;
}

.action-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Form Sections */
.form-section {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.form-section h2 {
    margin-bottom: 1.5rem;
}

.api-form .form-group {
    margin-bottom: 1.5rem;
}

.api-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.api-form input,
.api-form select,
.api-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.api-form input:focus,
.api-form select:focus,
.api-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.api-form small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-secondary:hover {
    background: #4a4d53;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Results */
.result-section {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.result-section h2 {
    margin-bottom: 1.5rem;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-field label {
    font-weight: 500;
    color: var(--text-secondary);
}

.copyable {
    display: flex;
    gap: 0.5rem;
}

.copyable input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: monospace;
    background: var(--bg-content);
}

.result-meta {
    display: flex;
    gap: 2rem;
    padding: 1rem;
    background: var(--bg-content);
    border-radius: var(--radius);
}

/* Info Cards */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.info-card h3 {
    margin-bottom: 1rem;
}

.info-card ul {
    list-style: none;
}

.info-card li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.info-card li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
}

.info-card p {
    color: var(--text-secondary);
}

/* Code Blocks */
.code-block {
    background: var(--bg-dark);
    color: #f8f8f2;
    padding: 1.5rem;
    border-radius: var(--radius);
    margin: 1rem 0;
    overflow-x: auto;
}

.code-block h3,
.code-block h4 {
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.code-block pre {
    margin: 0;
}

.code-block code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
}

/* API Docs */
.api-docs .api-section {
    margin-bottom: 3rem;
}

.endpoint {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.method {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

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

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

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

/* Recordings */
.recordings-list {
    margin-top: 1.5rem;
}

.recordings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.recording-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recording-info h3 {
    margin-bottom: 0.5rem;
}

.recording-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 1.5rem;
}

.flash {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.flash-error {
    background: #fce8e6;
    color: var(--danger);
}

.flash-success {
    background: #e6f4ea;
    color: var(--success);
}

/* Utilities */
.loading {
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem;
}

.empty {
    color: var(--text-secondary);
    text-align: center;
    padding: 3rem;
    font-style: italic;
}

.error {
    color: var(--danger);
    text-align: center;
    padding: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        padding: 1rem;
    }

    .nav-links {
        display: flex;
        gap: 0.5rem;
    }

    .content {
        margin-left: 0;
    }

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

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