/* Northern Gas Networks - IP Blocking System Styles */
:root {
    --ngn-purple: #5e2750;
    --ngn-purple-dark: #4a1e3f;
    --ngn-pink: #e91e8c;
    --ngn-blue: #00a9ce;
    --ngn-gradient: linear-gradient(135deg, var(--ngn-purple) 0%, var(--ngn-pink) 100%);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);
    --border-radius: 12px;
    --transition: all 0.2s ease;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
}

/* Login Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.login-header {
    background: var(--ngn-gradient);
    padding: 2.5rem 2rem;
    text-align: center;
    color: white;
}

.login-logo {
    height: 60px;
    margin-bottom: 1rem;
    filter: brightness(0) invert(1);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.login-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0.5rem 0 0;
}

.login-body {
    padding: 2rem;
}

.login-footer {
    padding: 1rem 2rem;
    background: #f8f9fa;
    text-align: center;
    border-top: 1px solid #eee;
}

.form-floating > label { color: #6c757d; }
.form-floating > .form-control:focus ~ label { color: var(--ngn-purple); }
.form-control:focus { border-color: var(--ngn-purple); box-shadow: 0 0 0 0.2rem rgba(94, 39, 80, 0.15); }

/* Navbar */
.navbar {
    background: var(--ngn-gradient);
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow-md);
}

.navbar-logo {
    height: 45px;
    margin-right: 1rem;
    filter: brightness(0) invert(1);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.brand-subtitle {
    font-size: 0.75rem;
    opacity: 0.8;
    color: white;
}

.connection-status {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.9);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white !important;
    text-decoration: none;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-name { font-weight: 500; }

/* Main Content */
.main-content {
    padding: 1.5rem;
    min-height: calc(100vh - 140px);
}

/* Stats Cards */
.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border-left: 4px solid;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-total { border-color: var(--ngn-purple); }
.stat-approved { border-color: #198754; }
.stat-expiring { border-color: #ffc107; }
.stat-permanent { border-color: #dc3545; }

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-total .stat-icon { background: rgba(94, 39, 80, 0.1); color: var(--ngn-purple); }
.stat-approved .stat-icon { background: rgba(25, 135, 84, 0.1); color: #198754; }
.stat-expiring .stat-icon { background: rgba(255, 193, 7, 0.1); color: #ffc107; }
.stat-permanent .stat-icon { background: rgba(220, 53, 69, 0.1); color: #dc3545; }

.stat-content { display: flex; flex-direction: column; }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.85rem; color: #6c757d; margin-top: 0.25rem; }

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.card-header {
    background: white;
    border-bottom: 1px solid #eee;
    padding: 1rem 1.5rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ngn-purple);
}

.card-body { padding: 1.5rem; }
.card-footer { background: #f8f9fa; border-top: 1px solid #eee; padding: 0.75rem 1.5rem; }

/* Table */
.table { margin: 0; }
.table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #495057;
    padding: 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
}

.table-hover tbody tr:hover { background: rgba(94, 39, 80, 0.03); }

.sortable { cursor: pointer; user-select: none; }
.sortable:hover { background: #e9ecef; }

/* Status Badges */
.badge-status {
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-approved { background: rgba(25, 135, 84, 0.1); color: #198754; }
.badge-pending { background: rgba(255, 193, 7, 0.1); color: #856404; }
.badge-blocked { background: rgba(220, 53, 69, 0.1); color: #dc3545; }

/* Buttons */
.btn-primary {
    background: var(--ngn-gradient);
    border: none;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: var(--transition);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--ngn-purple-dark) 0%, #d11a7a 100%);
    transform: translateY(-1px);
}

.btn-action {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-action:hover { transform: scale(1.1); }

/* Alerts */
.alert-container { position: fixed; top: 80px; right: 20px; z-index: 1050; width: 350px; }

.alert {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid #eee;
    padding: 1rem 1.5rem;
    font-size: 0.85rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Loading */
.loading-row td { border: none !important; }

/* Responsive */
@media (max-width: 768px) {
    .stat-card { padding: 1rem; }
    .stat-value { font-size: 1.5rem; }
    .main-content { padding: 1rem; }
    .navbar { padding: 0.5rem 1rem; }
    .brand-subtitle { display: none; }
}

/* IP Code Style */
.ip-code {
    font-family: 'Consolas', 'Monaco', monospace;
    background: #f1f3f4;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Tooltip */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 100;
}
