/**
 * WF Central - Styles
 * Design based on wfsecuritycloud.com
 */

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(254, 204, 0, 0.05);
    --bg-card-hover: rgba(254, 204, 0, 0.1);

    --accent-yellow: #FECC00;
    --accent-yellow-dark: #e5b800;
    --accent-green: #00ff88;
    --accent-red: #ff4637;
    --accent-blue: #60a5fa;

    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border-color: rgba(254, 204, 0, 0.15);
    --border-color-hover: rgba(254, 204, 0, 0.3);

    --radius: 8px;
    --radius-lg: 12px;

    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 4px 20px rgba(254, 204, 0, 0.2);

    --transition: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent-yellow);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-yellow-dark);
}

/* ============================================
   LAYOUT
   ============================================ */

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo img {
    height: 32px;
}

.sidebar-logo span {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-yellow);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 20px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-card);
    color: var(--accent-yellow);
    border-left-color: var(--accent-yellow);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--accent-red);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--accent-yellow);
    color: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-name {
    font-weight: 500;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
}

/* ============================================
   HEADER
   ============================================ */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
}

.page-title span {
    color: var(--accent-yellow);
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-color-hover);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
}

.card-link {
    font-size: 13px;
    color: var(--accent-yellow);
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.green { background: rgba(0, 255, 136, 0.15); color: var(--accent-green); }
.stat-icon.red { background: rgba(255, 70, 55, 0.15); color: var(--accent-red); }
.stat-icon.yellow { background: rgba(254, 204, 0, 0.15); color: var(--accent-yellow); }
.stat-icon.blue { background: rgba(96, 165, 250, 0.15); color: var(--accent-blue); }

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============================================
   TABLES
   ============================================ */

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
}

tr:hover td {
    background: var(--bg-card);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent-yellow);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: var(--accent-yellow-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
}

.btn-danger {
    background: rgba(255, 70, 55, 0.15);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
}

.btn-danger:hover {
    background: var(--accent-red);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ============================================
   STATUS INDICATORS
   ============================================ */

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-online .status-dot {
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
    animation: pulse 2s infinite;
}

.status-offline .status-dot {
    background: var(--accent-red);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
}

.badge-success { background: rgba(0, 255, 136, 0.15); color: var(--accent-green); }
.badge-danger { background: rgba(255, 70, 55, 0.15); color: var(--accent-red); }
.badge-warning { background: rgba(254, 204, 0, 0.15); color: var(--accent-yellow); }
.badge-info { background: rgba(96, 165, 250, 0.15); color: var(--accent-blue); }

/* Severity badges */
.severity-critical { background: rgba(255, 70, 55, 0.15); color: var(--accent-red); }
.severity-high { background: rgba(255, 150, 50, 0.15); color: #ff9632; }
.severity-medium { background: rgba(254, 204, 0, 0.15); color: var(--accent-yellow); }
.severity-low { background: rgba(96, 165, 250, 0.15); color: var(--accent-blue); }

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-yellow);
    box-shadow: 0 0 0 3px rgba(254, 204, 0, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* ============================================
   SEARCH BOX
   ============================================ */

.search-box {
    position: relative;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-yellow);
}

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

/* ============================================
   ALERTS / NOTICES
   ============================================ */

.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: var(--accent-green);
}

.alert-danger {
    background: rgba(255, 70, 55, 0.1);
    border: 1px solid rgba(255, 70, 55, 0.3);
    color: var(--accent-red);
}

.alert-warning {
    background: rgba(254, 204, 0, 0.1);
    border: 1px solid rgba(254, 204, 0, 0.3);
    color: var(--accent-yellow);
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    height: 48px;
    margin-bottom: 16px;
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 700;
}

.login-logo h1 span {
    color: var(--accent-yellow);
}

/* ============================================
   UTILITIES
   ============================================ */

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--accent-green); }
.text-danger { color: var(--accent-red); }
.text-warning { color: var(--accent-yellow); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

.code {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Button group */
.btn-group {
    display: inline-flex;
    gap: 4px;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}

.btn-secondary.active {
    background: var(--accent-yellow);
    color: var(--bg-primary);
    border-color: var(--accent-yellow);
}

/* Badge variations */
.badge-secondary {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
}

/* Select styling */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}
