/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 2px solid #eee;
    margin-bottom: 30px;
}

.header h1 {
    color: #667eea;
    font-size: 2rem;
}

.header h1 i {
    margin-right: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    font-weight: 500;
    color: #666;
}

/* Navigation Styles */
.navigation {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.nav-link {
    text-decoration: none;
    color: #666;
    padding: 10px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover,
.nav-link.active {
    background: #667eea;
    color: white;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-link {
    background: none;
    color: #667eea;
    padding: 5px 10px;
}

.btn-link:hover {
    background: #f8f9fa;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

.card-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.card-header h3 {
    color: #333;
    font-size: 1.2rem;
}

.card-header h3 i {
    margin-right: 10px;
    color: #667eea;
}

.card-body {
    padding: 20px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Audio Recording Styles */
.recording-controls {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 20px 0;
}

.record-button {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 10px;
}

.record-button.record {
    background: #dc3545;
}

.record-button.record:hover {
    background: #c82333;
}

.record-button.stop {
    background: #6c757d;
}

.record-button.stop:hover {
    background: #5a6268;
}

.record-button.play {
    background: #28a745;
}

.record-button.play:hover {
    background: #218838;
}

.recording-status {
    margin-top: 15px;
    font-weight: 500;
}

.recording-timer {
    font-size: 1.5rem;
    color: #dc3545;
    margin: 10px 0;
}

/* Audio Player Styles */
.audio-player {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin: 10px 0;
}

.audio-player audio {
    width: 100%;
}

/* Activity List */
.activity-list {
    list-style: none;
}

.activity-list li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-list li:last-child {
    border-bottom: none;
}

.activity-time {
    font-size: 0.9rem;
    color: #666;
}

.activity-desc {
    font-weight: 500;
}

/* Progress Bar */
.progress {
    background: #e9ecef;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar {
    background: #667eea;
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

/* Model Status */
.status-badge {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-pending {
    background: #ffc107;
    color: #212529;
}

.status-training {
    background: #17a2b8;
    color: white;
}

.status-completed {
    background: #28a745;
    color: white;
}

.status-failed {
    background: #dc3545;
    color: white;
}

/* Authentication Forms */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-form {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.auth-form .btn {
    width: 100%;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links a {
    color: #667eea;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Alert Messages */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Table Styles */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* Audio Player Styles */
.audio-player {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.audio-player audio {
    width: 100%;
    height: 40px;
}

.generation-info {
    background: #e9ecef;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.generation-info p {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-buttons .btn {
    flex: 1;
    min-width: 150px;
}

/* Alert Styles */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.alert a {
    font-weight: bold;
}

/* Generation Result Animation */
#generationResult {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Audio Player */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        flex: none;
        width: 100%;
    }
    
    .audio-player {
        padding: 15px;
    }
}

/* Loading State */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Sample Text Hover Effects */
.sample-text:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.sample-text:active {
    transform: translateY(0px);
}

/* Voice Model Status Indicators */
.voice-model-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-left: 8px;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-training {
    background-color: #cce5ff;
    color: #004085;
}

.status-failed {
    background-color: #f8d7da;
    color: #721c24;
}

/* Character and Word Count */
#charCount, #wordCount {
    font-weight: bold;
    color: #667eea;
}

/* Form Enhancement */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

select.form-control option[data-status="pending"],
select.form-control option[data-status="training"] {
    color: #856404;
    font-style: italic;
}

select.form-control option[data-status="completed"] {
    color: #155724;
    font-weight: 500;
}

select.form-control option[data-status="failed"] {
    color: #721c24;
    text-decoration: line-through;
}

/* Success/Error Message Styling */
.card[style*="border-color: #28a745"] .card-header {
    border-bottom: 1px solid #28a745;
}

.card[style*="border-color: #dc3545"] .card-header {
    border-bottom: 1px solid #dc3545;
}
    .container {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .navigation {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .record-button {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
