/* OpenVPN Manager - Styles */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;

    --radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

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

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

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
}

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

.user-info {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

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

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

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

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

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

.btn-warning {
    background: var(--warning);
    color: black;
}

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--bg-hover);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-google {
    background: white;
    color: #333;
    border: 1px solid #ddd;
}

.btn-google:hover {
    background: #f5f5f5;
}

.btn-microsoft {
    background: white;
    color: #333;
    border: 1px solid #ddd;
}

.btn-microsoft:hover {
    background: #f5f5f5;
}

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

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

.card-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    background: var(--secondary);
    color: white;
}

.badge-success {
    background: var(--success);
}

.badge-warning {
    background: var(--warning);
    color: black;
}

.badge-error {
    background: var(--danger);
}

.badge-info {
    background: var(--info);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    color: var(--warning);
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}

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

.login-header svg {
    color: var(--primary);
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

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

.login-options {
    margin-bottom: 2rem;
}

.org-section {
    margin-bottom: 1.5rem;
}

.org-section h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.oauth-buttons .btn {
    width: 100%;
    justify-content: center;
}

.login-footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Dashboard */
.dashboard {
    padding-bottom: 2rem;
}

.welcome-section {
    margin-bottom: 2rem;
}

.welcome-section h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.welcome-section p {
    color: var(--text-muted);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.ip-display {
    font-size: 1.5rem;
    font-family: monospace;
    background: var(--bg);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 1rem;
}

.ip-actions {
    text-align: center;
    margin-bottom: 1rem;
}

.auth-result {
    margin-top: 1rem;
}

.download-section {
    text-align: center;
    margin: 1.5rem 0;
}

.help-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.help-text ul {
    margin-top: 0.5rem;
    padding-left: 1.25rem;
}

.auth-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.auth-item.current {
    border: 1px solid var(--primary);
}

.auth-ip {
    font-family: monospace;
}

.auth-expires {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.instructions {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.instructions h2 {
    margin-bottom: 1rem;
}

.instructions ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.instructions li {
    margin-bottom: 0.5rem;
}

.note {
    background: var(--bg);
    padding: 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.admin-link {
    text-align: center;
    margin-top: 2rem;
}

/* Admin Dashboard */
.admin-dashboard {
    padding-bottom: 2rem;
}

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: var(--bg-hover);
}

.tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

.tab-content {
    display: none;
}

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

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

.tab-header select {
    padding: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.data-table code {
    background: var(--bg);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group select {
    width: 100%;
    padding: 0.625rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
}

.form-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* System Actions */
.system-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

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

.system-actions .card p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Utilities */
.loading {
    color: var(--text-muted);
    font-style: italic;
}

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

code {
    font-family: 'Monaco', 'Consolas', monospace;
}

/* Error Page */
.error-page {
    text-align: center;
    padding: 4rem 1rem;
}

.error-icon {
    color: var(--danger);
    margin-bottom: 1rem;
}

.error-page h1 {
    margin-bottom: 0.5rem;
}

.error-page p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
    }

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

    .admin-tabs {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
        text-align: center;
    }

    .data-table {
        font-size: 0.875rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}
