/**
 * ZigZap Admin Panel - Styles
 * Cores oficiais ZigZap
 */

/* ============================================
   VARIÁVEIS
   ============================================ */
:root {
    --brand-dark: #091620;
    --brand-blue: #467BC1;
    --brand-yellow: #EDCC25;
    --brand-white: #FFFFFF;
    --gradient-blue: linear-gradient(135deg, #467BC1 0%, #5a8dd4 100%);
    --gradient-yellow: linear-gradient(135deg, #EDCC25 0%, #f5d93f 100%);
    --gradient-dark: linear-gradient(135deg, #091620 0%, #0f2635 100%);
    --sidebar-width: 260px;
}

/* ============================================
   LAYOUT BASE
   ============================================ */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f5f7fb;
    min-height: 100vh;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-dark);
    padding: 2rem;
    margin: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: #333;
    margin-bottom: 0.5rem;
}

.login-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 0.5rem;
}

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

/* Login Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.divider span {
    padding: 0 1rem;
    color: #999;
    font-size: 0.875rem;
}

/* Google Button Container */
.google-btn-container {
    display: flex;
    justify-content: center;
    min-height: 44px;
}

.google-btn-container > div:first-child {
    width: 100% !important;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--gradient-dark);
    color: white;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 2px solid var(--brand-yellow);
}

.sidebar-header h4 {
    margin: 0;
    font-weight: 600;
}

.sidebar-logo {
    max-width: 160px;
    height: auto;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

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

.sidebar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: var(--brand-yellow);
}

.sidebar-nav .nav-link i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

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

.sidebar-footer .user-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.sidebar-footer .user-role {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 2rem;
}

.content-header {
    margin-bottom: 1.5rem;
}

.content-header h1 {
    color: #333;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.card-header {
    background: white;
    border-bottom: 1px solid #eee;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-header h5 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Stat Cards */
.stat-card {
    border-radius: 16px;
    overflow: hidden;
}

.stat-card .card-body {
    padding: 1.5rem;
}

.stat-card .stat-icon {
    font-size: 3rem;
    opacity: 0.3;
}

.stat-card h2 {
    font-size: 2rem;
    font-weight: 700;
}

/* Gradients */
.bg-gradient-primary {
    background: var(--gradient-blue) !important;
}

.bg-gradient-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

.bg-gradient-info {
    background: linear-gradient(135deg, #17a2b8 0%, #6610f2 100%) !important;
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%) !important;
}

/* ============================================
   TABLES
   ============================================ */
.table {
    margin: 0;
}

.table th {
    font-weight: 600;
    color: #666;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom-width: 1px;
}

.table td {
    vertical-align: middle;
}

/* ============================================
   AVATAR
   ============================================ */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ============================================
   CHARTS
   ============================================ */
.chart-container {
    height: 300px;
    position: relative;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    background: var(--gradient-blue);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #365f9a 0%, #467BC1 100%);
}

.btn-outline-primary {
    color: var(--brand-blue);
    border-color: var(--brand-blue);
}

.btn-outline-primary:hover {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
}

/* ============================================
   FORMS
   ============================================ */
.form-control:focus,
.form-select:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 0.2rem rgba(70, 123, 193, 0.25);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
}

.badge.bg-primary {
    background: var(--brand-blue) !important;
}

.badge.bg-warning {
    background: var(--brand-yellow) !important;
    color: var(--brand-dark) !important;
}

/* ============================================
   ZIGZAP ACCENTS
   ============================================ */
.text-primary {
    color: var(--brand-blue) !important;
}

.border-primary {
    border-color: var(--brand-blue) !important;
}

.bg-primary {
    background-color: var(--brand-blue) !important;
}

/* Yellow accent for important elements */
.stat-card h2 {
    text-shadow: 0 0 20px rgba(237, 204, 37, 0.3);
}

.sidebar-header {
    border-bottom: 2px solid var(--brand-yellow);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination .page-link {
    color: var(--brand-blue);
}

.pagination .page-item.active .page-link {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar-header h4,
    .sidebar-nav .nav-link span,
    .sidebar-footer .user-info > div {
        display: none;
    }
    
    .sidebar-nav .nav-link {
        justify-content: center;
        padding: 1rem;
    }
    
    .sidebar-footer .user-info {
        justify-content: center;
    }
    
    .main-content {
        margin-left: 70px;
    }
}

@media (max-width: 576px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 0;
    }
    
    .sidebar-nav .nav-link {
        flex-direction: column;
        font-size: 0.75rem;
        padding: 0.75rem 1rem;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .sidebar-nav .nav-link.active {
        border-bottom-color: var(--brand-yellow);
        border-left-color: transparent;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-white-50 {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Hide ng-view content during route change */
[ng-view].ng-enter {
    opacity: 0;
}

[ng-view].ng-enter-active {
    opacity: 1;
    transition: opacity 0.2s ease-in;
}
