/* Torrent Downloader - Custom Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

body {
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

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

.navbar-brand {
    font-weight: 700;
}

.nav-link i {
    margin-right: 0.5rem;
}

/* Card Styles */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

/* Stat Cards */
.stat-card {
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .card-body {
    padding: 1rem;
}

.stat-card h3 {
    margin-bottom: 0;
    font-weight: 700;
}

.stat-card h6 {
    margin-bottom: 0;
    opacity: 0.9;
}

/* Table Styles */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: #6c757d;
    border-top: none;
    border-bottom: 2px solid #dee2e6;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.table td {
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Torrent Name */
.torrent-name {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.torrent-name strong {
    color: #212529;
}

/* Progress Bar */
.progress {
    background-color: #e9ecef;
    border-radius: 0.5rem;
    overflow: hidden;
}

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

/* Badge Styles */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

/* Button Styles */
.btn {
    font-weight: 500;
    transition: all 0.2s;
}

.btn i {
    margin-right: 0.375rem;
}

.btn-group-sm > .btn {
    padding: 0.25rem 0.5rem;
}

.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-warning:hover,
.btn-outline-danger:hover {
    transform: translateY(-1px);
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background-color: #f8f9fa;
}

.drop-zone:hover {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
}

.drop-zone.drag-over {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.1);
}

.drop-zone i {
    color: #6c757d;
}

.drop-zone.drag-over i,
.drop-zone:hover i {
    color: var(--primary-color);
}

/* Form Styles */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 500;
    color: #495057;
}

.form-text {
    font-size: 0.8rem;
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 0.5rem;
}

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

/* Footer */
footer {
    background-color: #fff;
    border-top: 1px solid #dee2e6;
    margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .stat-card .card-body {
        padding: 0.75rem;
    }
    
    .stat-card h3 {
        font-size: 1.5rem;
    }
    
    .torrent-name {
        max-width: 150px;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-group-sm > .btn {
        padding: 0.2rem 0.4rem;
    }
}

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

.card {
    animation: fadeIn 0.3s ease-out;
}

/* Loading Spinner */
.spinner-border {
    width: 1rem;
    height: 1rem;
}

/* List Group */
.list-group-item {
    border-left: none;
    border-right: none;
    padding: 0.75rem 1rem;
}

.list-group-item:first-child {
    border-top: none;
}

.list-group-item:last-child {
    border-bottom: none;
}

/* Modal */
.modal-header {
    background-color: var(--primary-color);
    color: white;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

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

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

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

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

/* Empty State */
.text-muted i.display-1 {
    font-size: 5rem;
    opacity: 0.5;
}

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

.status-dot.pending {
    background-color: var(--secondary-color);
}

.status-dot.downloading {
    background-color: var(--warning-color);
    animation: pulse 1s infinite;
}

.status-dot.completed {
    background-color: var(--success-color);
}

.status-dot.error {
    background-color: var(--danger-color);
}

.status-dot.paused {
    background-color: var(--info-color);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Tooltip */
[data-bs-toggle="tooltip"] {
    cursor: help;
}
