/* ===============================================
   SINet - Main Stylesheet
   CSS Variables, Animations, Transitions & Effects
   =============================================== */

/* ===============================================
   CSS Variables
   =============================================== */
:root {
    /* Primary Colors */
    --primary-color: #1976D2;
    --primary-dark: #0D47A1;
    --primary-light: #64B5F6;
    
    /* Accent Colors */
    --accent-color: #FF6B35;
    
    /* Status Colors */
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    
    /* Neutral Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    
    /* Layout */
    --sidebar-width: 220px;
    --sidebar-bg: linear-gradient(180deg, #0D47A1 0%, #1565C0 100%);
    
    /* Spacing & Radius */
    --space: 8px;
    --radius: 12px;
    --radius-sm: 6px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

/* ===============================================
   Base Styles
   =============================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    background: var(--bg-page);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===============================================
   Header
   =============================================== */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-lg);
}

.header .logo {
    display: flex;
    align-items: center;
    padding-left: 15px;
}

.header .logo img {
    height: 36px;
    margin-right: 10px;
    transition: transform var(--transition-normal);
}

.header .logo:hover img {
    transform: rotate(10deg) scale(1.1);
}

.header .logo h1 {
    font-size: 22px;
    margin: 0;
    font-weight: 600;
}

.header .user-controls {
    margin-right: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header .user-controls a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
    font-weight: 500;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Slide-through shine effect */
.header .user-controls a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left var(--transition-normal);
}

.header .user-controls a:hover::before {
    left: 100%;
}

.header .user-controls a:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.header .user-controls a i {
    margin-right: 8px;
}

/* ===============================================
   Sidebar
   =============================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    position: fixed;
    height: auto;
    top: 60px;
    left: 0;
    overflow-y: auto;
    z-index: 900;
    transition: all var(--transition-normal);
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    border-radius: 0 0 var(--radius) 0;
}

.sidebar .nav-item {
    width: 100%;
    margin-bottom: 2px;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.85);
    padding: 15px 25px;
    display: flex;
    align-items: center;
    border-left: 4px solid transparent;
    transition: all var(--transition-normal);
    font-weight: 500;
    position: relative;
}

.sidebar .nav-link::after {
    content: '';
    position: absolute;
    right: 15px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    transition: all var(--transition-normal);
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    padding-left: 30px;
}

.sidebar .nav-link:hover::after {
    background: var(--primary-light);
    box-shadow: 0 0 10px var(--primary-light);
}

.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    border-left-color: var(--primary-light);
    color: white;
}

.sidebar .nav-link.active::after {
    background: var(--success-color);
    box-shadow: 0 0 10px var(--success-color);
}

.sidebar .nav-link i {
    margin-right: 15px;
    width: 24px;
    text-align: center;
    font-size: 18px;
    transition: transform var(--transition-normal);
}

.sidebar .nav-link:hover i {
    transform: scale(1.2);
}

/* ===============================================
   Main Content
   =============================================== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: 60px;
    padding: 25px;
    min-height: calc(100vh - 60px);
}

/* ===============================================
   Cards
   =============================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-header {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.card-header i {
    color: var(--primary-color);
    margin-right: 10px;
}

.card-body {
    padding: 20px;
}

/* ===============================================
   Stats Cards
   =============================================== */
.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
}

.stats-card {
    flex: 1;
    min-width: 200px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 25px;
    text-align: center;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out forwards;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
}

.stats-card:hover::before {
    transform: scaleX(1);
}

.stats-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.stats-icon {
    color: var(--primary-color);
    margin-bottom: 15px;
    transition: transform var(--transition-normal);
}

.stats-card:hover .stats-icon {
    transform: scale(1.2);
}

.stats-number {
    font-size: 42px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.stats-label {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stats-card:nth-child(1) { animation-delay: 0.1s; }
.stats-card:nth-child(2) { animation-delay: 0.2s; }
.stats-card:nth-child(3) { animation-delay: 0.3s; }
.stats-card:nth-child(4) { animation-delay: 0.4s; }

/* ===============================================
   Welcome Banner
   =============================================== */
.welcome-banner {
    background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
    border-radius: var(--radius);
    margin-bottom: 25px;
    padding: 30px;
    border-left: 5px solid var(--primary-color);
    position: relative;
    overflow: hidden;
    animation: fadeInLeft 0.6s ease-out forwards;
}

.welcome-banner::after {
    content: '🛰️';
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 60px;
    opacity: 0.2;
    transition: all 0.5s ease;
}

.welcome-banner:hover::after {
    opacity: 0.4;
    transform: translateY(-50%) rotate(15deg) scale(1.1);
}

.welcome-banner h2 {
    color: var(--primary-dark);
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 1.5rem;
}

.welcome-banner p {
    color: var(--text-secondary);
    margin: 0;
    max-width: 80%;
}

/* ===============================================
   Buttons
   =============================================== */
.btn {
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===============================================
   Tables
   =============================================== */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
    padding: 15px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table tbody tr {
    transition: all var(--transition-fast);
}

.table tbody tr:hover {
    background-color: #f0f9ff;
}

.table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
}

/* ===============================================
   Tooltips
   =============================================== */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: var(--text-primary);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 1000;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}

/* ===============================================
   Footer
   =============================================== */
.footer {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: rgba(255, 255, 255, 0.85);
    padding: 40px 0 0;
    margin-top: 40px;
    margin-left: 0;
    width: 100%;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px;
    padding: 0 20px;
}

.footer-brand {
    flex: 1;
    min-width: 250px;
    max-width: 350px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.footer-logo img {
    filter: brightness(0) invert(1);
    transition: transform var(--transition-normal);
}

.footer-logo:hover img {
    transform: rotate(10deg) scale(1.1);
}

.footer-title {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.footer-desc {
    opacity: 0.85;
    line-height: 1.7;
    font-size: 14px;
    margin: 0;
}

.footer-links {
    min-width: 150px;
}

.footer-links h4,
.footer-contact h4 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 10px;
}

.footer-links h4::after,
.footer-contact h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    background: var(--accent-color);
    border-radius: 2px;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.footer-links a:hover {
    color: white;
    transform: translateX(5px);
}

.footer-links a i {
    font-size: 12px;
    width: 16px;
}

.footer-contact {
    min-width: 150px;
}

.footer-social {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    transition: all var(--transition-normal);
}

.footer-social a:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4);
}

.footer-institution {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin: 0;
}

.footer-institution i {
    margin-right: 8px;
}

.footer-bottom {
    margin-top: 30px;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.footer-copyright {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.footer-copyright .fa-heart {
    color: #ef4444;
    animation: pulse 1.5s ease infinite;
}

.footer-divider {
    opacity: 0.5;
}

.footer-version {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 20px;
}

.footer-section {
    margin-bottom: 30px;
}

.footer-legal {
    font-size: 14px;
    opacity: 0.7;
}

/* ===============================================
   Animations
   =============================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* ===============================================
   Form Inputs
   =============================================== */
.form-control {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 15px;
    transition: all var(--transition-normal);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
    outline: none;
}

/* ===============================================
   Map & Chart Containers
   =============================================== */
.map-container {
    height: 500px;
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.chart-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
}

.chart-container h3 {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.chart-container h3 i {
    color: var(--primary-color);
    margin-right: 10px;
}

/* ===============================================
   Mobile Menu Toggle
   =============================================== */
.mobile-menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    display: none;
    margin-right: 15px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ===============================================
   Responsive Design
   =============================================== */
@media (max-width: 992px) {
    .sidebar {
        width: 60px;
    }
    .sidebar .nav-link span,
    .sidebar .nav-link::after {
        display: none;
    }
    .main-content,
    .footer {
        margin-left: 60px;
    }
}

@media (max-width: 768px) {
    .stats-row {
        flex-direction: column;
    }
    .stats-card {
        min-width: 100%;
    }
    .welcome-banner::after {
        display: none;
    }
    .welcome-banner p {
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .header .center-logo {
        display: none;
    }
    .sidebar {
        transform: translateX(-100%);
        width: 220px;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar .nav-link span,
    .sidebar .nav-link::after {
        display: block;
    }
    .main-content,
    .footer {
        margin-left: 0;
    }
    .mobile-menu-toggle {
        display: block;
    }
}

/* ===============================================
   Utility Classes
   =============================================== */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hover-lift {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Status Indicators */
.status-online::before,
.status-offline::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-online::before {
    background: var(--success-color);
    box-shadow: 0 0 8px var(--success-color);
    animation: pulse 2s infinite;
}

.status-offline::before {
    background: var(--error-color);
}
