@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.6);
    --card-border: rgba(148, 163, 184, 0.1);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --secondary-gradient: linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #f43f5e 100%);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success-color: #10b981;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(45, 212, 191, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    padding: 2rem;
    overflow-x: hidden;
}

/* Glassmorphism Utilities */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Layout */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    height: calc(100vh - 4rem);
}

/* Sidebar */
.sidebar {
    border-radius: 1.5rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100%;
    overflow-y: auto;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.control-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-field {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
    width: 100%;
}

.input-field:focus {
    outline: none;
    border-color: #6366f1;
}

textarea.input-field {
    resize: vertical;
    min-height: 100px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.4);
    padding: 0.25rem;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 1rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    position: relative;
    transition: all 0.2s;
}

input[type="radio"]:checked + .radio-custom {
    border-color: #a855f7;
}

input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--primary-gradient);
    border-radius: 50%;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary-gradient);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}

.btn-secondary {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--card-border);
}

.btn-danger {
    background: var(--danger-gradient);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

/* Main Content */
.main-content {
    border-radius: 1.5rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
}

.stat-group {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Table */
.table-container {
    flex: 1;
    overflow-y: auto;
    border-radius: 1rem;
    background: rgba(15, 23, 42, 0.3);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th {
    text-align: left;
    padding: 1rem;
    background: rgba(30, 41, 59, 0.9);
    position: sticky;
    top: 0;
    color: var(--text-muted);
    font-weight: 600;
    backdrop-filter: blur(4px);
    z-index: 10;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--card-border);
    color: var(--text-main);
}

tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

/* Progress */
.progress-container {
    margin-top: 1rem;
}

.progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--secondary-gradient);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    display: flex;
    justify-content: space-between;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.4);
}
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

.hidden {
    display: none !important;
}

/* History Container */
.history-container {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 0.75rem;
    padding: 0.5rem;
}

.history-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 1rem;
    font-size: 0.9rem;
}

.history-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 0.5rem;
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: #6366f1;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.history-item-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

.history-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.history-item-info {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.history-item-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.history-btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.history-btn-resume {
    background: var(--primary-gradient);
    color: white;
}

.history-btn-delete {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.history-btn:hover {
    transform: scale(1.05);
}

.history-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-size: 0.9rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    .main-content {
        height: 600px;
    }
}
