body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #02C160;
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: #06AE56;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
    border: none;
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 15px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #02C160;
    box-shadow: 0 0 0 2px rgba(2, 193, 96, 0.2);
}

/* Cards */
.card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.card-header h2 {
    font-size: 18px;
    color: #111827;
    margin: 0;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: #f9fafb;
}

th,
td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th {
    font-weight: 500;
    color: #6b7280;
    font-size: 14px;
}

td {
    color: #111827;
}

tr:hover {
    background-color: #f9fafb;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.alert-success {
    background-color: #dcfce7;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.hidden {
    display: none !important;
}

/* Auth pages */
.login-form,
.register-form {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.logo {
    text-align: center;
    margin-bottom: 20px;
}

.logo img {
    max-width: 80px;
    margin-bottom: 10px;
}

.logo h1 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.error-message {
    background-color: #fee2e2;
    color: #b91c1c;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 30px;
}

.custom-tooltip {
    position: absolute;
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    max-width: 250px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.custom-tooltip.visible {
    opacity: 1;
}

#model-select option:hover {
    background-color: #f0f0f0;
}

.ai-progress-bar {
    height: 3px;
    background: linear-gradient(90deg, #02c160, #576b95);
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    border: 1px solid #d1d5db;
    border-radius: 0 0 0 10px;
    animation: progressAnimation 10s ease-in-out forwards;
}

@keyframes progressAnimation {
    0% {
        width: 0%;
    }

    70% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.thinking-process {
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    overflow: hidden;
    transition: all 0.3s ease;
}

.thinking-process:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.thinking-header {
    padding: 10px 14px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    user-select: none;
    transition: all 0.2s ease;
}

.thinking-header:hover {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    color: #374151;
}

.thinking-header::before {
    content: '>';
    display: inline-block;
    font-size: 10px;
    transition: transform 0.3s ease;
    color: #9ca3af;
}

.thinking-process.open .thinking-header::before {
    transform: rotate(90deg);
    color: #02C160;
}

.thinking-process.thinking-active .thinking-header {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    animation: thinkingPulse 2s ease-in-out infinite;
}

@keyframes thinkingPulse {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

.thinking-content {
    display: none;
    padding: 14px;
    font-size: 13px;
    line-height: 1.6;
    color: #4b5563;
    border-top: 1px solid #e5e7eb;
    white-space: pre-wrap;
    background: #ffffff;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }

    to {
        opacity: 1;
        max-height: 500px;
    }
}

.thinking-process.open .thinking-content {
    display: block;
}

.thinking-icon {
    width: 14px;
    height: 14px;
    margin-right: 4px;
}

.thinking-process.thinking-active .thinking-icon {
    animation: rotate 2s linear infinite;
}

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

    to {
        transform: rotate(360deg);
    }
}

.quota-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid #d8dee6;
    border-radius: 6px;
    background: #f7f9fc;
    color: #344054;
    font-size: 12px;
    white-space: nowrap;
}

.quota-divider {
    color: #98a2b3;
}

@media (max-width: 768px) {
    .quota-status {
        width: 100%;
        justify-content: center;
    }
}
