/* AutoBackups Custom Styles */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --dark-color: #212529;
    
    /* Light theme colors */
    --bg-color: #f8f9fa;
    --surface-color: #ffffff;
    --text-color: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --hover-bg: rgba(0, 0, 0, 0.025);
    --shadow-color: rgba(0, 0, 0, 0.075);
    --shadow-hover: rgba(0, 0, 0, 0.15);
}

/* Dark theme colors */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --surface-color: #2d2d2d;
    --text-color: #e9ecef;
    --text-muted: #adb5bd;
    --border-color: #495057;
    --hover-bg: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.25);
    --shadow-hover: rgba(0, 0, 0, 0.35);
    --primary-color: #4dabf7;
    --success-color: #51cf66;
    --info-color: #22b8cf;
    --warning-color: #ffd43b;
    --danger-color: #ff6b6b;
}

/* General Styles */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.2rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.theme-toggle:hover {
    color: rgba(255, 255, 255, 0.9);
    background-color: rgba(255, 255, 255, 0.1);
}

/* Cards */
.card {
    border: none;
    border-radius: 0.5rem;
    background-color: var(--surface-color);
    box-shadow: 0 0.125rem 0.25rem var(--shadow-color);
    transition: box-shadow 0.15s ease-in-out, background-color 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem var(--shadow-hover);
}

.card-header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-color);
}

/* Statistics Cards */
.card.bg-primary,
.card.bg-success,
.card.bg-info,
.card.bg-warning {
    border: none;
}

.card.bg-primary .card-title,
.card.bg-success .card-title,
.card.bg-info .card-title,
.card.bg-warning .card-title {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.card.bg-primary .card-text,
.card.bg-success .card-text,
.card.bg-info .card-text,
.card.bg-warning .card-text {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
}

/* Tables */
.table {
    background-color: var(--surface-color);
    color: var(--text-color);
}

.table-hover tbody tr:hover {
    background-color: var(--hover-bg);
}

.table th {
    border-top: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}

.table td {
    vertical-align: middle;
    border-color: var(--border-color);
    color: var(--text-color);
}

/* Badges */
.badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn-group-sm > .btn,
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-dismissible .btn-close {
    padding: 1.25rem 1rem;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: 0.5rem;
    background-color: var(--surface-color);
    color: var(--text-color);
    box-shadow: 0 0.5rem 1rem var(--shadow-hover);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* Form Controls */
.form-control,
.form-select {
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    background-color: var(--surface-color);
    color: var(--text-color);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    background-color: var(--surface-color);
    color: var(--text-color);
}

/* Dark theme form controls */
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(77, 171, 247, 0.25);
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Custom Utilities */
.text-truncate-50 {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .card.bg-primary .card-text,
    .card.bg-success .card-text,
    .card.bg-info .card-text,
    .card.bg-warning .card-text {
        font-size: 1.5rem;
    }
    
    .btn-group-sm > .btn {
        padding: 0.125rem 0.25rem;
        font-size: 0.75rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* Status Indicators */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-ready { background-color: var(--success-color); }
.status-error { background-color: var(--danger-color); }
.status-warning { background-color: var(--warning-color); }
.status-info { background-color: var(--info-color); }

/* Progress Bars */
.progress {
    height: 0.5rem;
    border-radius: 0.25rem;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Custom Scrollbar */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-color);
}

.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Dark theme specific overrides */
[data-theme="dark"] .navbar-dark {
    background-color: #1e2329 !important;
}

[data-theme="dark"] .btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

[data-theme="dark"] .btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

[data-theme="dark"] .alert {
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .dropdown-menu {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-color);
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: var(--hover-bg);
    color: var(--text-color);
}

[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

/* Dark theme table specific fixes */
[data-theme="dark"] .table {
    background-color: var(--surface-color);
    color: var(--text-color);
}

[data-theme="dark"] .table td {
    background-color: var(--surface-color);
    color: var(--text-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .table th {
    background-color: var(--surface-color);
    color: var(--text-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .table tbody tr {
    background-color: var(--surface-color);
}

[data-theme="dark"] .table-hover tbody tr:hover {
    background-color: var(--hover-bg);
}

[data-theme="dark"] .table-hover tbody tr:hover td {
    background-color: var(--hover-bg);
}

/* Fix for Bootstrap table striped rows in dark theme */
[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) td {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Dark theme card fixes */
[data-theme="dark"] .card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
}

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

[data-theme="dark"] .card-header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

/* Dark theme input group fixes */
[data-theme="dark"] .input-group-text {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

/* Dark theme pagination fixes */
[data-theme="dark"] .page-link {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .page-link:hover {
    background-color: var(--hover-bg);
    color: var(--text-color);
}

[data-theme="dark"] .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Dark theme accordion fixes */
[data-theme="dark"] .accordion-item {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .accordion-button {
    background-color: var(--surface-color);
    color: var(--text-color);
}

[data-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: var(--hover-bg);
    color: var(--text-color);
}

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

/* Fix for list-group items in dark theme */
[data-theme="dark"] .list-group-item {
    background-color: var(--surface-color) !important;
    border-color: var(--border-color) !important;
    color: var(--text-color) !important;
}

/* Fix for table-dark header in light theme */
[data-theme="light"] .table-dark th,
:root:not([data-theme="dark"]) .table-dark th {
    background-color: #343a40 !important;
    color: white !important;
    border-color: #495057 !important;
}

/* Ensure table-dark works correctly in both themes */
[data-theme="dark"] .table-dark th {
    background-color: #495057 !important;
    color: white !important;
    border-color: #6c757d !important;
}
