/* ====== Modern Light Theme Styles ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    color: #1f2937;
    line-height: 1.6;
}

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

/* ====== Navigation ====== */
.navbar {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 0;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1f2937;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    color: #3b82f6;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1rem;
    align-items: center;
}

.nav-menu a {
    color: #4b5563;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.nav-menu a:hover {
    background: #f3f4f6;
    color: #1f2937;
    transform: translateY(-1px);
}

.tokens {
    background: #ffffff;
    color: #3b82f6;
    border: 1px solid #e5e7eb;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.tokens i {
    margin-right: 0.3rem;
    color: #3b82f6;
}

/* ====== Alerts ====== */
.alert {
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    animation: slideIn 0.25s ease-out;
    font-size: 0.95rem;
    border: 1px solid transparent;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.alert-success {
    border-color: #10b981;
    background: #f0fdf4;
    color: #166534;
}

.alert-danger {
    border-color: #ef4444;
    background: #fef2f2;
    color: #dc2626;
}

.alert-warning {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

.alert-info {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
}

/* ====== Hero Section ====== */
.hero {
    background: #ffffff;
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    animation: cardIn 0.35s ease-out;
    border: 1px solid #e5e7eb;
}

.hero h1 {
    font-size: 2.6rem;
    color: #1f2937;
    margin-bottom: 1rem;
    letter-spacing: 0.03em;
}

.hero h1 i {
    color: #3b82f6;
    margin-right: 0.5rem;
}

.lead {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 2.2rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.6rem;
    margin: 2rem 0;
}

.feature {
    background: #ffffff;
    border-radius: 14px;
    padding: 1.5rem 1.3rem;
    text-align: left;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transform: translateY(0);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.feature:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.feature h3 {
    color: #1f2937;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.feature h3 i {
    color: #3b82f6;
    margin-right: 0.5rem;
}

.feature p {
    color: #6b7280;
    font-size: 0.95rem;
}

.cta {
    margin: 2rem 0;
}

.pricing-info {
    background: #f8fafc;
    padding: 1.5rem 1.7rem;
    border-radius: 14px;
    margin-top: 2rem;
    border: 1px solid #e5e7eb;
}

.pricing-info h3 {
    color: #1f2937;
    margin-bottom: 0.6rem;
}

.pricing-info h3 i {
    color: #3b82f6;
    margin-right: 0.5rem;
}

.pricing-info p {
    color: #6b7280;
}

/* ====== Buttons ====== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.6rem;
    border-radius: 12px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.18s ease;
    letter-spacing: 0.02em;
}

.btn-primary {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: #ffffff;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #f9fafb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-outline {
    background: #ffffff;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.btn-outline:hover {
    background: #f9fafb;
    color: #374151;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
    margin: 0.4rem;
}

.btn-block {
    width: 100%;
}

/* ====== Authentication Forms ====== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.auth-box {
    background: #ffffff;
    padding: 2.5rem 2.7rem;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 420px;
    animation: cardIn 0.3s ease-out;
    border: 1px solid #e5e7eb;
}

.auth-box h2 {
    color: #1f2937;
    margin-bottom: 1.3rem;
    text-align: center;
}

.bonus-info {
    background: #f0fdf4;
    color: #166534;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.3rem;
    text-align: center;
    border: 1px solid #bbf7d0;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: #374151;
    font-size: 0.93rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border-radius: 10px;
    font-size: 0.96rem;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #1f2937;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.12s ease;
}

.form-control::placeholder {
    color: #9ca3af;
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #ffffff;
    transform: translateY(-1px);
}

.error {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1rem;
}

.auth-footer a {
    color: #3b82f6;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ====== Dashboard and Video Section ====== */
.dashboard {
    background: #ffffff;
    border-radius: 20px;
    padding: 2rem 2.2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    animation: cardIn 0.3s ease-out;
    border: 1px solid #e5e7eb;
}

.dashboard h1 {
    color: #1f2937;
    margin-bottom: 1.4rem;
}

.user-info {
    background: #f8fafc;
    padding: 1.4rem 1.5rem;
    border-radius: 14px;
    margin-bottom: 1.9rem;
    border: 1px solid #e5e7eb;
}

.token-count {
    color: #3b82f6;
    font-size: 1.35rem;
}

.hint {
    color: #6b7280;
    font-size: 0.9rem;
    font-style: italic;
}

.tts-form {
    margin-bottom: 2rem;
}

.char-counter {
    text-align: right;
    color: #6b7280;
    font-size: 0.86rem;
    margin-top: 0.4rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 150px;
}

/* ====== History ====== */
.history {
    margin-top: 2rem;
}

.history h2 {
    color: #1f2937;
    margin-bottom: 1rem;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.history-table th,
.history-table td {
    padding: 0.9rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.93rem;
}

.history-table th {
    background: #f9fafb;
    font-weight: 500;
    color: #374151;
}

.history-table tr:last-child td {
    border-bottom: none;
}

.history-table tr:hover {
    background: #f3f4f6;
}

/* ====== Admin Panel ====== */
.admin-panel {
    background: #ffffff;
    border-radius: 20px;
    padding: 2rem 2.2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    animation: cardIn 0.3s ease-out;
    border: 1px solid #e5e7eb;
}

.admin-panel h1 {
    color: #1f2937;
    margin-bottom: 2rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 1.4rem 1.3rem;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.stat-number {
    font-size: 2.3rem;
    font-weight: 700;
    margin-top: 0.4rem;
}

.grant-tokens,
.grant-admin,
.users-list,
.transactions {
    margin-bottom: 2rem;
}

.grant-admin {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
}

.grant-admin h2 {
    color: #1f2937;
    margin-bottom: 1rem;
}

.change-password {
    margin-top: 2rem;
}

.change-password h2 {
    color: #1f2937;
    margin-bottom: 1rem;
}

.grant-tokens h2,
.users-list h2,
.transactions h2 {
    color: #1f2937;
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.users-table,
.transactions-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.users-table th,
.users-table td,
.transactions-table th,
.transactions-table td {
    padding: 0.9rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.93rem;
}

.users-table th,
.transactions-table th {
    background: #f9fafb;
    font-weight: 500;
    color: #374151;
}

.users-table tr:last-child td,
.transactions-table tr:last-child td {
    border-bottom: none;
}

.users-table tr:hover,
.transactions-table tr:hover {
    background: #f3f4f6;
}

.positive {
    color: #10b981;
    font-weight: 600;
}

.negative {
    color: #ef4444;
    font-weight: 600;
}

/* ====== Footer ====== */
footer {
    background: #f9fafb;
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
}

/* ====== Pricing Page ====== */
.pricing-page {
    background: #ffffff;
    border-radius: 20px;
    padding: 2.5rem 2.2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    animation: cardIn 0.3s ease-out;
    border: 1px solid #e5e7eb;
}

.pricing-page h1 {
    color: #1f2937;
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
}

.pricing-page .lead {
    text-align: center;
    color: #6b7280;
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
}

.pricing-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.pricing-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid #e5e7eb;
    position: relative;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.pricing-card:hover {
    transform: translateY(-4px);
    border-color: #3b82f6;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.1);
}

.pricing-card.popular {
    border: 2px solid #3b82f6;
    background: #f0f9ff;
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.pricing-card h2 {
    color: #1f2937;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.price {
    margin-bottom: 0.5rem;
}

.price .amount {
    color: #3b82f6;
    font-size: 3rem;
    font-weight: 700;
}

.tokens {
    color: #6b7280;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.pricing-card .description {
    color: #6b7280;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.price-per-token {
    color: #10b981;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.pricing-info {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    margin-top: 2rem;
}

.pricing-info h3 {
    color: #1f2937;
    margin-bottom: 1rem;
}

.pricing-info ul {
    list-style: none;
    padding: 0;
    color: #6b7280;
}

.pricing-info li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.pricing-info li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

/* ====== Transcribe Page ====== */
.transcribe-form {
    margin-bottom: 2rem;
}

.transcribe-form h2 {
    color: #1f2937;
    margin-bottom: 1rem;
}

.form-hint {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.file-input {
    padding: 0.75rem;
    background: #ffffff;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input:hover {
    border-color: #3b82f6;
    background: #f9fafb;
}

.file-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-text {
    display: block;
    margin-top: 0.5rem;
    color: #6b7280;
    font-size: 0.85rem;
}

.transcribe-info {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    margin-top: 2rem;
}

.transcribe-info h3 {
    color: #1f2937;
    margin-bottom: 1rem;
}

.transcribe-info ul {
    list-style: none;
    padding: 0;
    color: #6b7280;
}

.transcribe-info li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.transcribe-info li:before {
    content: "🎯";
    position: absolute;
    left: 0;
}

/* ====== Общая анимация карточек ====== */
@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ====== Адаптивность ====== */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 0.8rem;
    }

    .hero {
        padding: 2rem 1.1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .dashboard,
    .admin-panel,
    .pricing-page {
        padding: 1.6rem 1.4rem;
    }

    .transcribe-info {
        padding: 1.2rem;
    }

    .pricing-plans {
        grid-template-columns: 1fr;
    }

    .pricing-page h1 {
        font-size: 2rem;
    }
}

/* ====== Video Preview ====== */
.video-preview {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    margin-top: 1.5rem;
}

.video-preview h3 {
    color: #1f2937;
    margin-bottom: 1rem;
}

.video-info {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.video-thumbnail {
    width: 180px;
    height: 102px;
    max-width: 180px;
    max-height: 102px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.video-details {
    flex: 1;
}

.video-details h4 {
    color: #1f2937;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.video-details p {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

/* ====== Progress Bar ====== */
.progress-bar {
    width: 100%;
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

#progress-text {
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
}
