:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #10b981;
    --error: #ef4444;
    --border: #334155;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    padding: 2rem 1rem;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.logout-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.logout-link:hover {
    color: var(--error);
}

.input-section {
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-card);
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

input[type="text"] {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    outline: none;
}

input[type="text"]::placeholder {
    color: var(--text-muted);
}

button#submit-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

button#submit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

button#submit-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.status-msg {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid var(--primary);
    color: var(--primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    animation: pulse 2s infinite ease-in-out;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.9;
        transform: scale(0.995);
    }
}

.progress-container {
    width: 100%;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.progress-bar-bg {
    width: 100%;
    height: 12px;
    background: var(--border);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #818cf8, #a78bfa);
    background-size: 200% 100%;
    animation: gradient-shift 2s linear infinite;
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.progress-label {
    color: var(--text-main);
}

.progress-value {
    color: var(--primary);
    font-weight: 700;
}

.hidden {
    display: none;
}

.card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border);
    margin-bottom: 3rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem 0;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.tab-content {
    font-size: 1.05rem;
    color: var(--text-main);
    line-height: 1.8;
    white-space: pre-wrap;
}

/* Content Analysis Visualization */
.analysis-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0;
}

.analysis-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    color: var(--text-main);
}

.percentage-label {
    color: var(--primary);
    font-weight: 700;
}

.progress-track {
    width: 100%;
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary), #818cf8);
    border-radius: 5px;
    width: 0;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.analysis-container.animate .progress-fill {
    width: var(--width);
}

.history-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: var(--text-main);
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.history-item {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.history-item h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-item p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

@media (max-width: 640px) {
    .input-group {
        flex-direction: column;
    }

    button#submit-btn {
        width: 100%;
    }
}