/* Global Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #f3f4f6;
    --text-color: #1f2937;
    --card-bg: #ffffff;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* Login Page with Glassmorphism */
.login-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    text-align: center;
    color: white;
}

.login-card h2 {
    margin-bottom: 2rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.8);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.btn-login {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-login:hover {
    background-color: var(--primary-hover);
}

/* Dashboard Layout */
.dashboard-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.header-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-info h3 {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-info p {
    margin: 0.5rem 0 0;
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-color);
}

.chart-container {
    width: 80px;
    height: 80px;
}

/* Controls Section */
.controls-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.search-box {
    flex: 1;
    min-width: 300px;
    display: flex;
    gap: 0.5rem;
}

.filter-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.select-style {
    padding: 0.5rem 2rem 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background-color: white;
    font-size: 0.875rem;
    color: var(--text-color);
    outline: none;
    cursor: pointer;
}

/* Data Table */
.table-container {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: #f9fafb;
    padding: 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e7eb;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    color: var(--text-color);
    vertical-align: middle;
}

tr:hover {
    background-color: #f9fafb;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-completed { background-color: #d1fae5; color: #065f46; }
.status-downloading { background-color: #dbeafe; color: #1e40af; }
.status-waiting { background-color: #fef3c7; color: #92400e; }
.status-fail { background-color: #fee2e2; color: #991b1b; }

.btn-retry {
    padding: 0.4rem 0.8rem;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-retry:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.pagination {
    display: flex;
    justify-content: center;
    padding: 1.5rem;
    gap: 0.5rem;
}

.page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    color: #374151;
}

.page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Utility */
.text-truncate {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
