/**
 * KiraGuard License Panel - Custom Styles
 * Modern, Dark Theme with Glassmorphism
 * Version: 2.0.0
 */

/* ===== CSS Variables ===== */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --danger-gradient: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    --warning-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    
    --bg-dark: #1a1a2e;
    --bg-darker: #16213e;
    --bg-darkest: #0f3460;
    
    --card-bg: rgba(255, 255, 255, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    
    --border-radius: 16px;
    --border-radius-sm: 10px;
    --transition: all 0.3s ease;
}

/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 50%, var(--bg-darkest) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

/* ===== Navbar ===== */
.navbar {
    background: rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.75rem 1rem !important;
    border-radius: var(--border-radius-sm);
    margin: 0 4px;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary) !important;
    background: var(--glass-bg);
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* ===== Cards ===== */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.card-header {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--glass-border);
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid var(--glass-border);
    padding: 1rem 1.5rem;
}

/* ===== Buttons ===== */
.btn {
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

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

.btn-gradient:hover {
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    color: white;
}

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

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

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

.btn-outline-secondary:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
    border-color: var(--glass-border);
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

/* ===== Forms ===== */
.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
    color: var(--text-primary);
}

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

.form-control:disabled,
.form-control[readonly] {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
}

.form-label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

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

.form-check-input {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--glass-border);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

.input-group .btn {
    border-color: var(--glass-border);
}

.input-group .btn:hover {
    background: var(--glass-bg);
}

.was-validated .form-control:valid,
.form-control.is-valid {
    border-color: #28a745;
}

.was-validated .form-control:invalid,
.form-control.is-invalid {
    border-color: #dc3545;
}

/* ===== Tables ===== */
.table {
    color: var(--text-secondary);
    margin-bottom: 0;
}

.table thead th {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    color: var(--text-muted);
}

.table tbody td {
    border-color: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.table-active {
    background: rgba(102, 126, 234, 0.1) !important;
}

/* ===== Badges ===== */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
    border-radius: 6px;
}

.badge-role {
    padding: 0.5em 1em;
}

/* ===== Alerts ===== */
.alert {
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 1rem 1.25rem;
}

.alert-success {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.alert-info {
    background: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
}

/* ===== Avatar ===== */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

/* ===== Stat Cards ===== */
.stat-card {
    background: var(--glass-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

/* ===== Page Header ===== */
.page-header {
    padding: 1.5rem 0;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

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

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

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

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

/* ===== Dropdown ===== */
.dropdown-menu {
    background: rgba(30, 30, 50, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.dropdown-item {
    color: var(--text-secondary);
    padding: 0.625rem 1rem;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
}

.dropdown-divider {
    border-color: var(--glass-border);
}

/* ===== Progress ===== */
.progress {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    height: 8px;
}

.progress-bar {
    border-radius: 10px;
}

/* ===== DataTables ===== */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1rem;
}

.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--text-secondary) !important;
    border: 1px solid var(--glass-border);
    background: transparent;
    border-radius: var(--border-radius-sm);
    margin: 0 2px;
    padding: 0.5rem 0.75rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--glass-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--glass-border);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-gradient) !important;
    color: white !important;
    border: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    color: var(--text-muted) !important;
    cursor: not-allowed;
}

.dataTables_wrapper .dataTables_info {
    color: var(--text-muted);
    padding-top: 1rem;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label {
    color: var(--text-muted);
}

/* ===== Footer ===== */
footer {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== Selection ===== */
::selection {
    background: var(--primary-color);
    color: white;
}

/* ===== Animations ===== */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

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

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ===== Tooltip ===== */
.tooltip-inner {
    background: rgba(30, 30, 50, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: rgba(30, 30, 50, 0.95);
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: rgba(30, 30, 50, 0.95);
}

/* ===== SweetAlert2 Customization ===== */
.swal2-popup {
    background: rgba(30, 30, 50, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius) !important;
}

.swal2-title {
    color: var(--text-primary) !important;
}

.swal2-html-container {
    color: var(--text-secondary) !important;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.5rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: var(--border-radius-sm) !important;
        margin-bottom: 0.25rem;
    }
}

/* ===== Utility Classes ===== */
.bg-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
}

.border-glass {
    border: 1px solid var(--glass-border);
}

.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-glow {
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.3);
}

.min-vh-75 {
    min-height: 75vh;
}

.cursor-pointer {
    cursor: pointer;
}

/* ===== Loading Spinner ===== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Code Blocks ===== */
code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.875em;
    color: #e83e8c;
}

pre {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    overflow-x: auto;
}

pre code {
    background: transparent;
    padding: 0;
    color: var(--text-secondary);
}
