/**
app/static/css/main.css
* Estilos customizados do Sistema de Controle de Energia
 */

/* ========== GLOBAL ========== */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.95rem;
    color: #333;
}

/* ========== NAVBAR ========== */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand img {
    transition: transform 0.3s ease;
}

.navbar-brand img:hover {
    transform: scale(1.05);
}

/* ========== SIDEBAR ========== */
.sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover {
    background-color: rgba(0, 0, 0, .05);
    padding-left: 1.5rem;
}

.sidebar .nav-link.active {
    color: var(--primary-color);
    background-color: rgba(0, 123, 255, .1);
    border-left: 3px solid var(--primary-color);
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar-heading {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========== MAIN CONTENT ========== */
main {
    padding-top: 20px;
}

/* ========== CARDS ========== */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    font-weight: 600;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

/* ========== BUTTONS ========== */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn i {
    vertical-align: middle;
}

/* ========== TABLES ========== */
.table {
    font-size: 0.9rem;
}

.table thead th {
    background-color: var(--light-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--primary-color);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
    cursor: pointer;
}

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

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

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
}

.invalid-feedback {
    font-size: 0.875rem;
}

/* ========== BREADCRUMB ========== */
.breadcrumb {
    background-color: transparent;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
}

.breadcrumb-item a {
    text-decoration: none;
    color: var(--primary-color);
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* ========== ALERTS ========== */
.alert {
    border-left: 4px solid;
    border-radius: 0.375rem;
}

.alert-success {
    border-left-color: var(--success-color);
}

.alert-info {
    border-left-color: var(--info-color);
}

.alert-warning {
    border-left-color: var(--warning-color);
}

.alert-danger {
    border-left-color: var(--danger-color);
}

/* ========== DATATABLES ========== */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 0.375rem;
}

/* ========== DASHBOARD CARDS ========== */
.dashboard-card {
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    border-left-width: 8px;
}

.dashboard-card .icon-box {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* ========== LOADING SPINNER ========== */
.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 0.25rem solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .sidebar {
        position: relative;
        top: 0;
    }

    main {
        padding-top: 10px;
    }

    .card {
        margin-bottom: 1rem;
    }
}

/* ========== UTILITIES ========== */
.text-shadow {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.box-shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.box-shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.box-shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* ========== PRINT STYLES ========== */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .breadcrumb {
        display: none;
    }

    main {
        margin: 0;
        padding: 0;
    }
}