<?php
/**
 * Custom CSS
 * Sistema SaaS Multi-Purpose
 */

/* Theme Toggle */
[data-theme="dark"] {
    --body-bg: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-color: #c2c2c2;
    --border-color: #444;
}

body[data-theme="dark"] {
    background-color: var(--body-bg);
    color: var(--text-color);
}

body[data-theme="dark"] .card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

body[data-theme="dark"] .main-sidebar {
    background-color: #1f1f1f;
}

body[data-theme="dark"] .nav-sidebar > .nav-item > .nav-link {
    color: #c2c2c2;
}

body[data-theme="dark"] .nav-sidebar > .nav-item > .nav-link:hover {
    background-color: #2d2d2d;
}

body[data-theme="dark"] .main-header {
    background-color: #2d2d2d;
}

body[data-theme="dark"] .content-wrapper {
    background-color: #1a1a1a;
}

/* Toastr Customization */
.toast-success {
    background-color: #28a745 !important;
}

.toast-error {
    background-color: #dc3545 !important;
}

.toast-warning {
    background-color: #ffc107 !important;
}

.toast-info {
    background-color: #17a2b8 !important;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #333;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #666;
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    padding: 10px 0;
}

.table td, .table th {
    vertical-align: middle;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    animation: fadeIn 0.5s ease-in-out;
}

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

/* Card Hover Effect */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    display: none;
}

.loading-overlay.show {
    display: flex;
}

/* Sidebar Mini */
.sidebar-mini .nav-sidebar {
    padding-top: 10px;
}

.nav-header {
    padding: 10px 15px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: #6c757d;
}

/* Form Controls */
.form-control:focus,
.custom-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .custom-select {
    background-color: #333;
    border-color: #555;
    color: #fff;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .custom-select:focus {
    background-color: #444;
    border-color: #80bdff;
    color: #fff;
}

/* Buttons */
.btn-outline-primary {
    color: #007bff;
    border-color: #007bff;
}

[data-theme="dark"] .btn-outline-primary {
    color: #6ea8fe;
    border-color: #6ea8fe;
}

/* Badges */
.badge {
    padding: 0.4em 0.6em;
    font-weight: 500;
}

/* Modal Customization */
.modal-header {
    border-bottom: 1px solid #dee2e6;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
}

[data-theme="dark"] .modal-header {
    border-bottom-color: #444;
}

[data-theme="dark"] .modal-footer {
    border-top-color: #444;
}

/* PWA Install Banner */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #007bff;
    color: white;
    padding: 15px;
    display: none;
    z-index: 9999;
    animation: slideUp 0.3s ease;
}

.pwa-install-banner.show {
    display: block;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Calendar Events */
.fc-event {
    cursor: pointer;
    border-radius: 4px;
}

.fc-toolbar-title {
    font-size: 1.5rem !important;
}

/* Notification Badge */
.navbar-badge {
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 50%;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .login-box {
        width: 100% !important;
        padding: 20px;
    }
    
    .small-box {
        margin-bottom: 20px;
    }
}

/* Print Styles */
@media print {
    .main-sidebar,
    .main-header,
    .content-header,
    .main-footer,
    .no-print {
        display: none !important;
    }
    
    .content-wrapper {
        margin-left: 0 !important;
        padding: 0 !important;
    }
}
