/**
 * AI Audio News Generator - Frontend Styles
 */

.aang-frontend-recorder {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.aang-frontend-recorder h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #1e1e1e;
}

/* Buttons */
.aang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.aang-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.aang-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.aang-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.aang-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.aang-btn-secondary:hover:not(:disabled) {
    background: #e0e0e0;
}

.aang-btn-link {
    background: transparent;
    color: #667eea;
    padding: 8px 16px;
}

.aang-btn-link:hover {
    text-decoration: underline;
}

.aang-btn-large {
    padding: 16px 32px;
    font-size: 16px;
    width: 100%;
}

/* Icons */
.aang-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
}

.aang-icon-mic::before {
    content: "🎤";
}

.aang-icon-stop::before {
    content: "⏹️";
}

.aang-icon-ai::before {
    content: "✨";
}

.aang-icon-check::before {
    content: "✅";
}

.aang-icon-error::before {
    content: "❌";
}

/* Recorder Section */
.aang-recorder-section {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.aang-recorder-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.aang-recording-timer {
    font-family: monospace;
    font-size: 20px;
    font-weight: 700;
    color: #1e1e1e;
    padding: 8px 16px;
    background: #f5f5f5;
    border-radius: 8px;
    min-width: 70px;
    text-align: center;
}

.aang-recording-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: transparent;
}

.aang-recording-indicator.active {
    background: #dc3545;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Audio Preview */
.aang-audio-preview {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.aang-audio-player {
    width: 100%;
    margin-bottom: 10px;
}

/* Prompt Section */
.aang-prompt-section {
    margin-bottom: 25px;
}

.aang-prompt-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.aang-custom-prompt {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s;
}

.aang-custom-prompt:focus {
    outline: none;
    border-color: #667eea;
}

/* Category Section */
.aang-category-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.aang-category-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.aang-category-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}

.aang-category-select:focus {
    outline: none;
    border-color: #667eea;
}

/* Featured Image Section */
.aang-featured-image-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.aang-featured-image-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.aang-featured-image-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
}

.aang-featured-image-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
}

.aang-select-featured-image {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    padding: 0;
}

.aang-select-featured-image .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

/* Actions Section */
.aang-actions-section {
    margin-bottom: 25px;
}

.aang-processing-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f4ff 0%, #f5f0ff 100%);
    border-radius: 8px;
    margin-top: 15px;
}

.aang-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.aang-status-text {
    font-size: 15px;
    color: #667eea;
    font-weight: 500;
}

/* Result Section */
.aang-result-section {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 8px;
}

.aang-success-message {
    margin-bottom: 20px;
}

.aang-success-message h4 {
    margin: 10px 0 0 0;
    font-size: 20px;
    color: #155724;
}

.aang-result-links {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 15px;
}

/* Error Section */
.aang-error-section {
    text-align: center;
    padding: 30px;
    background: #f8d7da;
    border-radius: 8px;
}

.aang-error-message {
    margin-bottom: 20px;
}

.aang-error-text {
    color: #721c24;
    margin: 10px 0 0 0;
}

/* Error message for non-logged users */
.aang-error {
    padding: 20px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 8px;
    text-align: center;
}

/* Responsive */
@media (max-width: 600px) {
    .aang-frontend-recorder {
        padding: 20px;
        margin: 10px;
    }
    
    .aang-recorder-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .aang-result-links {
        flex-direction: column;
    }
}
