/* RM PLAY - Painel IPTV Custom Styles */

/* Variáveis CSS */
:root {
    --rmplay-primary: #007bff;
    --rmplay-secondary: #6c757d;
    --rmplay-success: #28a745;
    --rmplay-danger: #dc3545;
    --rmplay-warning: #ffc107;
    --rmplay-info: #17a2b8;
    --rmplay-dark: #343a40;
    --rmplay-light: #f8f9fa;
    --rmplay-white: #ffffff;
    
    --border-radius: 0.5rem;
    --transition: all 0.3s ease;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    --shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
    --shadow-lg: 0 1rem 3rem rgba(0,0,0,0.175);
}

/* Reset e Base */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Componentes Base */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    animation: fadeIn 0.5s ease;
}

.card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--rmplay-primary);
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* Sidebar */
.sidebar {
    background: linear-gradient(135deg, var(--rmplay-dark), #495057);
    min-height: 100vh;
    transition: var(--transition);
    animation: slideIn 0.5s ease;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    transition: var(--transition);
    border-radius: var(--border-radius);
    margin: 0.2rem 0;
    padding: 0.75rem 1rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: white;
    background: rgba(255,255,255,0.1);
    transform: translateX(5px);
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    background: var(--rmplay-light);
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background: var(--rmplay-white) !important;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 0;
}

/* Breadcrumbs */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #6c757d;
}

/* Stats Cards */
.stats-card {
    background: linear-gradient(135deg, var(--rmplay-primary), #0056b3);
    color: white;
    overflow: hidden;
    position: relative;
}

.stats-card.success {
    background: linear-gradient(135deg, var(--rmplay-success), #1e7e34);
}

.stats-card.warning {
    background: linear-gradient(135deg, var(--rmplay-warning), #e0a800);
    color: #333;
}

.stats-card.danger {
    background: linear-gradient(135deg, var(--rmplay-danger), #bd2130);
}

.stats-card.info {
    background: linear-gradient(135deg, var(--rmplay-info), #138496);
}

.stats-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transform: rotate(45deg);
}

/* Quick Actions */
.quick-actions .card {
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.quick-actions .card:hover {
    transform: translateY(-5px);
    border-color: currentColor;
    animation: pulse 0.5s ease;
}

/* Alerts */
.alert {
    border-radius: var(--border-radius);
    border: none;
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: currentColor;
}

/* Tables */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table th {
    background: var(--rmplay-light);
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table td {
    border-color: #f1f3f4;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: rgba(0,123,255,0.05);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
}

/* Dropdowns */
.dropdown-menu {
    border: none;
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
}

.dropdown-item:hover {
    background: rgba(0,123,255,0.1);
    color: var(--rmplay-primary);
}

/* Modals */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: var(--rmplay-light);
    border-bottom: 1px solid #dee2e6;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Progress Bars */
.progress {
    height: 8px;
    border-radius: var(--border-radius);
    background: #e9ecef;
}

.progress-bar {
    border-radius: var(--border-radius);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.5s ease;
}

.timeline-item:before {
    content: "";
    position: absolute;
    left: -1.5rem;
    top: 0.5rem;
    width: 2px;
    height: calc(100% + 1.5rem);
    background: linear-gradient(to bottom, #dee2e6, transparent);
}

.timeline-item:last-child:before {
    display: none;
}

.timeline-marker {
    position: absolute;
    left: -2rem;
    top: 0.5rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #dee2e6;
    z-index: 1;
}

.timeline-content {
    background: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    border-left: 3px solid var(--rmplay-primary);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.timeline-content:hover {
    box-shadow: var(--shadow);
    transform: translateX(5px);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100% !important;
        position: fixed;
        z-index: 1000;
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .stats-card h4 {
        font-size: 1.5rem;
    }
    
    .quick-actions .col-lg-3 {
        margin-bottom: 1rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --rmplay-light: #1a1a1a;
        --rmplay-white: #2d2d2d;
    }
    
    body {
        background: #1a1a1a;
        color: #f8f9fa;
    }
    
    .card {
        background: #2d2d2d;
        color: #f8f9fa;
    }
    
    .table th {
        background: #3d3d3d;
        color: #f8f9fa;
    }
}

/* Utility Classes */
.hover-shadow:hover {
    box-shadow: var(--shadow) !important;
}

.hover-lift:hover {
    transform: translateY(-2px);
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-in {
    animation: slideIn 0.5s ease;
}

.text-gradient {
    background: linear-gradient(135deg, var(--rmplay-primary), var(--rmplay-info));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Print Styles */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .alert {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}