/* GridPane Security Dashboard - Stylesheet */

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #475569;
    --radius: 8px;
}

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

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

/* Navigation */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.nav-brand a {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

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

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text);
}

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

.nav-user span {
    color: var(--text-muted);
}

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

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

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

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

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

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

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

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

.btn-block {
    width: 100%;
}

/* Role & Status Badges */
.role-badge, .status-badge, .plan-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    text-transform: uppercase;
}

.role-staff {
    background-color: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.role-customer {
    background-color: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.status-pending {
    background-color: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.status-gridpane_running, .status-vector_running {
    background-color: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.status-complete {
    background-color: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.status-failed {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.plan-freemium {
    background-color: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
}

.plan-premium {
    background-color: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 1.75rem;
}

.dashboard-actions {
    display: flex;
    gap: 0.75rem;
}

.dashboard-filters {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.filter-group {
    flex: 1;
    max-width: 300px;
}

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

.filter-group select {
    width: 100%;
    padding: 0.625rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.875rem;
}

/* Server Cards */
.servers-overview h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.server-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.server-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.server-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.server-card-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-style: dashed;
    color: var(--text-muted);
}

.server-card-add .add-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.server-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.server-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.server-details p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* Sites Table */
.sites-section {
    margin-top: 2rem;
}

.sites-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.sites-table-wrapper {
    overflow-x: auto;
}

.sites-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-secondary);
    border-radius: var(--radius);
    overflow: hidden;
}

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

.sites-table th {
    background-color: var(--bg-tertiary);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sites-table tbody tr:hover {
    background-color: var(--bg-tertiary);
}

.site-name a {
    color: var(--primary);
    text-decoration: none;
}

.site-name a:hover {
    text-decoration: underline;
}

.wp-version {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.125rem 0.5rem;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.attack-count {
    font-weight: 500;
    text-align: center;
}

.attack-count.has-attacks {
    color: var(--warning);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background-color: var(--bg-secondary);
    border-radius: var(--radius);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

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

.modal-content {
    background-color: var(--bg-secondary);
    border-radius: var(--radius);
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 1.125rem;
}

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

.modal-body {
    padding: 1.5rem;
}

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

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

.breakdown-table th {
    font-weight: 600;
    color: var(--text-muted);
}

.breakdown-table td:first-child {
    max-width: 500px;
}

/* Auth Pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-box {
    background-color: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 2rem;
    border: 1px solid var(--border);
}

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

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

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

.auth-form .form-group {
    margin-bottom: 1.25rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
}

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

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

.auth-brand {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-muted);
}

/* Forms */
.form-page {
    max-width: 700px;
    margin: 0 auto;
}

.form-header {
    margin-bottom: 2rem;
}

.form-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

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

.main-form {
    background-color: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 2rem;
    border: 1px solid var(--border);
}

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

.form-section h2 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.section-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.875rem;
}

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

.form-group small {
    display: block;
    margin-top: 0.375rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.checkbox-group {
    margin-bottom: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* Info Box */
.info-box {
    background-color: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.info-box h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.code-block {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--bg);
    padding: 0.75rem;
    border-radius: 4px;
    margin: 0.75rem 0;
}

.code-block code {
    flex: 1;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.8125rem;
    word-break: break-all;
}

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

.info-text code {
    background-color: var(--bg);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
}

/* Data Table */
.list-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-secondary);
    border-radius: var(--radius);
    overflow: hidden;
}

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

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

.data-table tbody tr:hover {
    background-color: var(--bg-tertiary);
}

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

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

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

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

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

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        order: 3;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .dashboard-filters {
        flex-direction: column;
    }
    
    .filter-group {
        max-width: none;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}
