@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&display=swap');

:root {
    --bg-main: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-sidebar: #1e293b;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --bg-sidebar: #0a0f1d;
    --accent-primary: #3b82f6;
    --accent-secondary: #1d4ed8;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border: #1e293b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-card: rgba(30, 41, 59, 0.7);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --sidebar-width: 280px;
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    line-height: 1.5;
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2394a3b8' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Effects */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15), transparent 40%),
                radial-gradient(circle at 100% 100%, rgba(139, 92, 246, 0.1), transparent 40%);
    pointer-events: none;
    z-index: -1;
}

/* Layout Structure */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
}

/* Custom scrollbar for sidebar to keep it looking clean */
.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-logo {
    font-family: 'Outfit', sans-serif;
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 1rem 0;
}

.sidebar-logo-icon {
    width: 120px;
    height: 120px;
    border: 3px solid var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('../logo.png');
    background-size: cover;
    background-position: center;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
    flex-shrink: 0;
    color: transparent;
    overflow: hidden;
}

.banner-bg {
    background-image: linear-gradient(to right, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.6)), url('../banner.png') !important;
    background-size: cover !important;
    background-position: center !important;
    border: 1px solid var(--border) !important;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar-link.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 3rem;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: white;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Glass Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-4px);
}

/* Dashboard Widgets */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, white, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

/* Table Design */
.data-table-container {
    overflow-x: auto;
    border-radius: 1rem;
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(15, 23, 42, 0.5);
}

.data-table th {
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Badge Styles */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-info { background: rgba(99, 102, 241, 0.1); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.2); }
.badge-secondary { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); border: 1px solid var(--border); }

/* Progress Bars */
.progress-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 9999px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 0px;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
        width: 280px;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }
}

/* Profile Specific */
.profile-hero {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.profile-avatar-container {
    position: relative;
}

.profile-avatar {
    width: 250px;
    height: 250px;
    border-radius: 2rem;
    object-fit: cover;
    border: 4px solid var(--bg-sidebar);
    box-shadow: var(--shadow-lg);
}

.attribute-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.25rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    text-align: center;
}

.attribute-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-primary);
}

.attribute-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

/* Organization Grid */
.org-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Form Styling */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: white;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Utility */
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }

.text-center { text-align: center; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.flex-direction-column { flex-direction: column; }
.w-full { width: 100%; }
.mt-4 { margin-top: 1rem; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Loading State */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Urban Link Loader */
.urban-loader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #020617;
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
}

.urban-loader.active { display: flex; }

.loader-scanline {
    position: absolute;
    width: 100%;
    height: 2px;
    background: rgba(99, 102, 241, 0.2);
    top: -2px;
    animation: scan 3s linear infinite;
}

@keyframes scan {
    from { top: 0%; }
    to { top: 100%; }
}

.loader-text {
    color: var(--accent-primary);
    font-size: 1rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-top: 2rem;
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.loader-hex {
    font-size: 0.75rem;
    color: rgba(99, 102, 241, 0.3);
    max-width: 400px;
    text-align: center;
    word-break: break-all;
    margin-top: 1rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}
.modal.active { display: flex; }
.modal-content { width: 100%; max-width: 500px; }

/* Newspaper Aesthetic */
.newspaper-paper {
    background-color: #f4f1ea !important;
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(0,0,0,0.02) 0%, transparent 100%),
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise' %3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E") !important;
    color: #1a1a1a !important;
    font-family: 'Playfair Display', serif !important;
    padding: 2.5rem !important;
    border: 1px solid #dcd7c9 !important;
    box-shadow: 
        2px 2px 0px rgba(0,0,0,0.05),
        10px 10px 30px rgba(0,0,0,0.2) !important;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease !important;
}

.newspaper-paper::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 6px;
    background: repeating-linear-gradient(90deg, #1a1a1a 0, #1a1a1a 10px, transparent 10px, transparent 20px);
    opacity: 0.15;
}

.newspaper-masthead {
    border-bottom: 3px double #1a1a1a;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    text-align: center;
}

.unn-logo {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 2.5rem;
    letter-spacing: -1px;
    text-transform: uppercase;
    line-height: 1;
    margin: 0;
    color: #000;
    border-bottom: 1px solid #000;
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 5px;
}

.unn-tagline {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
    color: #333;
}

.newspaper-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 800;
    border-bottom: 1px solid #1a1a1a;
    padding: 0.4rem 0;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
}

.newspaper-title {
    font-size: 2.25rem !important;
    font-weight: 900 !important;
    line-height: 1.1 !important;
    margin-bottom: 1.5rem !important;
    color: #000 !important;
    text-align: center;
    font-family: 'Playfair Display', serif !important;
}

.newspaper-content {
    font-size: 1.05rem !important;
    line-height: 1.6 !important;
    color: #222 !important;
    text-align: justify;
}

.newspaper-columns {
    column-count: 2;
    column-gap: 2.5rem;
    column-rule: 1px solid rgba(0,0,0,0.1);
}

.newspaper-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.1);
    font-size: 0.85rem;
    font-style: italic;
    color: #444;
    display: flex;
    justify-content: space-between;
}

.breaking-stamp {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    border: 3px solid #c00;
    color: #c00;
    padding: 0.25rem 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    transform: rotate(12deg);
    font-size: 1.2rem;
    opacity: 0.7;
    pointer-events: none;
    user-select: none;
    font-family: 'Inter', sans-serif;
    letter-spacing: 1px;
}

/* Modern Matte Vitals status bars for Profile */
.vitals-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.vitals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.vital-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.vital-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
}

.vital-name {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
}

.vital-value {
    font-family: monospace;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.vital-bar-bg {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.vital-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.4s ease;
}

/* Matte Solid Vitals Colors */
.fill-hp {
    background: #ef4444; /* Crimson */
}

.fill-ap {
    background: #6b7280; /* Matte grey */
}

.fill-stamina {
    background: #10b981; /* Forest green */
}

.fill-food {
    background: #f59e0b; /* Amber */
}

.fill-air {
    background: #06b6d4; /* Slate-blue/cyan */
}
