/* assets/css/custom.css */

/* Custom CSS for ElevenLabs TTS Dashboard */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* Body and Layout */
body {
    background: var(--primary-gradient);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    text-decoration: none;
}

.navbar-brand:hover {
    color: white !important;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

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

.card-glass {
    background: rgba(255, 255, 255, 0.95);
}

.card-gradient {
    background: var(--primary-gradient);
    color: white;
}

/* Buttons */
.btn-gradient {
    background: var(--primary-gradient);
    border: none;
    color: white;
    font-weight: 600;
    transition: var(--transition);
}

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

.btn-gradient:focus {
    color: white;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}

.btn-outline-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                var(--primary-gradient) border-box;
    color: #667eea;
    font-weight: 600;
}

.btn-outline-gradient:hover {
    background: var(--primary-gradient);
    color: white;
}

/* Sidebar */
.sidebar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    min-height: calc(100vh - 2rem);
    position: sticky;
    top: 1rem;
}

.sidebar .nav-link {
    color: #495057;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    border-radius: 8px;
    transition: var(--transition);
    text-decoration: none;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: var(--primary-gradient);
    color: white;
    transform: translateX(5px);
}

.sidebar .nav-link i {
    width: 1.2rem;
}

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

/* Authentication Pages */
.auth-container {
    max-width: 400px;
    margin: 5rem auto;
}

.auth-container .card {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Forms */
.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.15);
}

.input-group-text {
    background: rgba(102, 126, 234, 0.1);
    border-color: #e1e5e9;
    color: #667eea;
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

/* Status Badges */
.status-badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-processing {
    background: #fff3cd;
    color: #856404;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

.status-pending {
    background: #e2e3e5;
    color: #41464b;
}

.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-suspended {
    background: #f8d7da;
    color: #721c24;
}

.status-expired {
    background: #f8d7da;
    color: #721c24;
}

/* Credit Display */
.credit-card {
    background: var(--primary-gradient);
    color: white;
    border-radius: var(--border-radius);
}

.credit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.credit-title {
    font-size: 1.2em;
    font-weight: 600;
    margin: 0;
}

.refresh-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--transition);
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.balance-display {
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.credits-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.credit-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.credit-amount {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.credit-expiry {
    font-size: 0.9em;
    opacity: 0.8;
}

/* Task and File Items */
.task-item,
.file-item,
.user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    margin: 0.5rem 0;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.task-item:hover,
.file-item:hover,
.user-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.task-info,
.file-info,
.user-info {
    flex: 1;
    margin-right: 1rem;
}

.task-text,
.file-name,
.user-name {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-meta,
.file-date,
.user-meta {
    font-size: 0.875rem;
    color: #6c757d;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Audio Controls */
.audio-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.audio-controls audio {
    flex: 1;
    min-width: 250px;
    border-radius: 8px;
}

.download-btn {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
    color: white;
    text-decoration: none;
}

/* Progress and Loading */
.progress-container {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    border: 1px solid #e9ecef;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 0.75rem 0;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    text-align: center;
    color: #6c757d;
    font-weight: 500;
}

.spinner-grow-sm {
    width: 1rem;
    height: 1rem;
}

.loading-credits {
    text-align: center;
    opacity: 0.7;
    padding: 1rem;
}

/* Alerts and Messages */
.alert {
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
}

.alert-gradient {
    background: var(--primary-gradient);
    color: white;
}

/* Tables */
.table {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.table thead th {
    background: var(--primary-gradient);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

.table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

/* Pagination */
.pagination .page-link {
    color: #667eea;
    border-color: #dee2e6;
    transition: var(--transition);
}

.pagination .page-item.active .page-link {
    background: var(--primary-gradient);
    border-color: #667eea;
}

.pagination .page-link:hover {
    color: white;
    background: var(--primary-gradient);
    border-color: #667eea;
}

/* Dropdowns */
.dropdown-menu {
    border: none;
    box-shadow: var(--card-shadow);
    border-radius: var(--border-radius);
}

.dropdown-item:hover {
    background: var(--primary-gradient);
    color: white;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 8rem);
}

/* Statistics Cards */
.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

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

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        margin: 2rem auto;
    }
    
    .sidebar {
        margin-bottom: 1rem;
        min-height: auto;
        position: static;
    }
    
    .credit-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .credits-list {
        grid-template-columns: 1fr;
    }
    
    .task-item,
    .file-item,
    .user-item {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .task-info,
    .file-info,
    .user-info {
        margin-right: 0;
    }
    
    .audio-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .audio-controls audio {
        min-width: unset;
    }
    
    .task-text,
    .file-name,
    .user-name {
        white-space: normal;
        max-width: none;
    }
    
    .task-meta,
    .file-date,
    .user-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .sidebar {
        border-radius: 8px;
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .balance-display {
        font-size: 1.25em;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .card-glass {
        background: rgba(30, 30, 30, 0.95);
        color: #e9ecef;
    }
    
    .sidebar {
        background: rgba(30, 30, 30, 0.95);
    }
    
    .sidebar .nav-link {
        color: #adb5bd;
    }
    
    .task-item,
    .file-item,
    .user-item {
        background: rgba(40, 40, 40, 0.95);
        color: #e9ecef;
    }
    
    .task-text,
    .file-name,
    .user-name {
        color: #e9ecef;
    }
}

/* Animation utilities */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

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

/* Utility classes */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.border-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                var(--primary-gradient) border-box;
}

.shadow-gradient {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.cursor-pointer {
    cursor: pointer;
}

.user-select-none {
    user-select: none;
}