/* Основные стили для Clickol WebApp */

:root {
    --tg-theme-bg-color: #ffffff;
    --tg-theme-text-color: #000000;
    --tg-theme-hint-color: #999999;
    --tg-theme-link-color: #2481cc;
    --tg-theme-button-color: #2481cc;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-secondary-bg-color: #f4f4f5;
    
    --primary-color: #2481cc;
    --success-color: #4CAF50;
    --danger-color: #f44336;
    --warning-color: #ff9800;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--tg-theme-hint-color);
    font-size: 14px;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 12px;
    margin-bottom: 30px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.user-status {
    color: var(--tg-theme-hint-color);
    font-size: 14px;
}

/* Recording Section */
.recording-section {
    text-align: center;
    margin: 40px 0;
}

.timer {
    font-size: 48px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin-bottom: 30px;
    color: var(--tg-theme-hint-color);
}

.timer.recording {
    color: var(--danger-color);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.record-btn-wrapper {
    margin: 30px 0;
}

.record-btn {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.record-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.record-btn:active {
    transform: scale(0.95);
}

.record-btn.recording {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
    animation: recordingPulse 1.5s infinite;
}

@keyframes recordingPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.record-icon {
    font-size: 32px;
}

.record-text {
    font-size: 12px;
    font-weight: 600;
}

.duration-info {
    color: var(--tg-theme-hint-color);
    font-size: 14px;
    margin-top: 15px;
}

/* Visualizer */
.visualizer {
    width: 100%;
    height: 80px;
    margin: 20px 0;
    border-radius: 8px;
    background: var(--tg-theme-secondary-bg-color);
    display: none;
}

.visualizer.active {
    display: block;
}

/* Controls */
.controls {
    display: flex;
    gap: 12px;
    margin: 30px 0;
}

.btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: var(--success-color);
    color: white;
}

.btn-primary:disabled {
    background: var(--tg-theme-hint-color);
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--tg-theme-secondary-bg-color);
    color: var(--danger-color);
}

/* Progress */
.progress-wrapper {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    margin-top: 8px;
    font-size: 14px;
    color: var(--tg-theme-hint-color);
}

/* Recordings Section */
.recordings-section {
    margin-top: 50px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.recordings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--tg-theme-hint-color);
    font-size: 14px;
}

.empty-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--tg-theme-hint-color);
    font-size: 16px;
    line-height: 1.8;
}

.empty-message small {
    font-size: 14px;
    opacity: 0.7;
}

.recording-item {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.recording-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.recording-info {
    flex: 1;
}

.recording-duration {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.recording-date {
    color: var(--tg-theme-hint-color);
    font-size: 12px;
}

.recording-status {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.recording-status.uploaded {
    background: var(--success-color);
    color: white;
}

.recording-status.processing {
    background: var(--warning-color);
    color: white;
}

.recording-status.error {
    background: var(--danger-color);
    color: white;
}

/* Recording Actions */
.recording-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: var(--tg-theme-button-color);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:active {
    transform: scale(0.9);
}

.btn-icon.play-btn {
    background: var(--success-color);
}

.btn-icon.delete-btn {
    background: var(--danger-color);
}

/* Delete All Test Button */
.delete-all-test-btn {
    width: 100%;
    margin-bottom: 15px;
    padding: 12px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-all-test-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

/* Telegram WebApp specific */
body.tg-viewport {
    background: var(--tg-theme-bg-color);
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 24px;
    }
    
    .timer {
        font-size: 40px;
    }
    
    .record-btn {
        width: 100px;
        height: 100px;
    }
}
