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

/* CSS Variables - will be set by theme.js */
:root {
    --body-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: #ffffff;
    --card-text: #333333;
    --header-text: #ffffff;
    --header-sub-text: rgba(255, 255, 255, 0.9);
    --tab-btn-bg: #ffffff;
    --tab-btn-text: #667eea;
    --tab-btn-active-bg: #764ba2;
    --tab-btn-active-text: #ffffff;
    --tab-btn-hover-bg: #f8f9fa;
    --border-color: #e0e0e0;
    --input-border: #e0e0e0;
    --input-focus-border: #667eea;
    --primary-btn-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-btn-text: #ffffff;
    --secondary-btn-bg: #6c757d;
    --secondary-btn-text: #ffffff;
    --danger-btn-bg: #e74c3c;
    --danger-btn-text: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --table-header-bg: #667eea;
    --table-header-text: #ffffff;
    --table-row-hover: #f8f9fa;
    --modal-overlay: rgba(0, 0, 0, 0.6);
    --modal-bg: #ffffff;
    --success-bg: #d4edda;
    --success-text: #155724;
    --error-bg: #f8d7da;
    --error-text: #721c24;
    --warning-bg: #fff3cd;
    --warning-text: #856404;
    --filter-section-bg: #f9f9f9;
    --filter-section-text: #555555;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--body-bg);
    min-height: 100vh;
    padding: 20px;
    transition: background 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    color: var(--header-text);
    margin-bottom: 30px;
    position: relative;
}

header > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    flex-direction: row;
}

header > div > div:first-child,
.header-logo {
    text-align: left;
    order: 1 !important;
}

.header-controls {
    order: 2 !important;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: var(--header-text);
    text-align: left;
}

.site-logo {
    max-width: 350px;
    height: auto;
    display: block;
}

header p {
    font-size: 1.1em;
    color: var(--header-sub-text);
    text-align: left;
}

.session-info-text {
    color: var(--header-sub-text) !important;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: var(--tab-btn-bg);
    color: var(--tab-btn-text);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: var(--tab-btn-hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.tab-btn.active {
    background: var(--tab-btn-active-bg);
    color: var(--tab-btn-active-text);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

h2 {
    color: var(--header-text);
    margin-bottom: 20px;
    font-size: 1.8em;
}

.card {
    background: var(--card-bg);
    color: var(--card-text);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    transition: background 0.3s ease, color 0.3s ease;
}

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

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--input-border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: var(--card-bg);
    color: var(--text-primary);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Dark theme specific input overrides */
.theme-dark input[type="text"],
.theme-dark input[type="email"],
.theme-dark input[type="password"],
.theme-dark input[type="number"],
.theme-dark select,
.theme-dark textarea {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--input-border) !important;
}

.theme-dark input::placeholder,
.theme-dark select::placeholder,
.theme-dark textarea::placeholder {
    color: var(--text-tertiary) !important;
    opacity: 0.7;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary:hover {
    opacity: 0.9;
}

.btn-danger {
    background: var(--danger-btn-bg);
    color: var(--danger-btn-text);
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.message {
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    font-weight: 500;
}

.message.success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-text);
}

.message.error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-text);
}

.message.info {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid var(--warning-text);
}

.user-item, .key-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.user-item:last-child,
.key-item:last-child {
    border-bottom: none;
}

.user-info, .key-info {
    flex: 1;
}

.user-info h3, .key-info h3 {
    color: var(--text-primary);
    margin-bottom: 5px;
}

.user-info p, .key-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
}

.badge.success {
    background: #d4edda;
    color: #155724;
}

.badge.info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge.warning {
    background: #fff3cd;
    color: #856404;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-tertiary);
}

.empty-state p {
    font-size: 16px;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

table thead {
    background: var(--table-header-bg);
    color: var(--table-header-text);
}

table thead th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

table tbody tr:hover {
    background: var(--table-row-hover);
}

table tbody td {
    padding: 12px;
    font-size: 14px;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.symbols-table {
    width: 100%;
}

@media (max-width: 768px) {
    .symbols-table {
        font-size: 12px;
    }
    
    table thead th,
    table tbody td {
        padding: 8px 4px;
    }
    
    .btn-sm {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: var(--modal-bg);
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 32px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #333;
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.modal-success .modal-title {
    color: #27ae60;
}

.modal-error .modal-title {
    color: #e74c3c;
}

.modal-info-grid {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.modal-info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: var(--table-row-hover);
    border-radius: 8px;
    border-left: 4px solid var(--input-focus-border);
}

.modal-info-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.modal-info-value {
    font-weight: 500;
    color: var(--text-primary);
}

.modal-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 20px;
}

.modal-message {
    text-align: center;
    margin: 20px 0;
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Theme Switcher Styles */
.theme-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 10px;
    border-radius: 18px;
    backdrop-filter: blur(10px);
    margin-bottom: 8px;
    align-self: flex-start;
}

.theme-switcher-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--header-text);
    margin-right: 2px;
    display: none; /* Hide label to save space */
}

.theme-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--header-text);
    padding: 4px 8px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 3px;
    transition: all 0.2s ease;
    min-width: auto;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.theme-btn.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

.theme-icon {
    font-size: 14px;
    line-height: 1;
}

.theme-name {
    font-size: 10px;
    white-space: nowrap;
}

/* Ensure theme switcher doesn't collide with buttons */
header div:has(#theme-switcher) {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

/* Pin login page special positioning */
.pin-container ~ #theme-switcher,
body:has(.pin-container) #theme-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

/* Hide text labels on small screens or make compact */
@media (max-width: 768px) {
    .theme-switcher {
        gap: 4px;
        padding: 4px 6px;
    }
    
    .theme-btn {
        padding: 4px 6px;
        gap: 2px;
    }
    
    .theme-name {
        display: none; /* Hide text, show only icons on mobile */
    }
}

/* Adjust theme switcher for non-default themes */
.theme-light .theme-switcher,
.theme-dark .theme-switcher {
    background: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-light .theme-switcher-label,
.theme-light .theme-btn {
    color: var(--text-primary);
}

.theme-dark .theme-switcher-label,
.theme-dark .theme-btn {
    color: var(--text-primary);
}

.theme-light .theme-btn {
    border-color: var(--border-color);
}

.theme-dark .theme-btn {
    border-color: var(--border-color);
}

.theme-light .theme-btn:hover,
.theme-dark .theme-btn:hover {
    background: var(--table-row-hover);
}

.theme-light .theme-btn.active,
.theme-dark .theme-btn.active {
    background: var(--input-focus-border);
    color: white;
    border-color: var(--input-focus-border);
}

/* Filter Section Styles */
.filter-section {
    background-color: var(--filter-section-bg) !important;
}

.filter-section h3 {
    color: var(--filter-section-text) !important;
}

