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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #40C4FF 0%, #2979FF 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    text-align: center;
    padding: 20px 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.icon {
    font-size: 0rem;
    margin-bottom: 1px;
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.main-content {
    padding: 40px;
}

.input-section {
   /*  margin-bottom: 40px; */
}

.input-section label {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.url-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.url-input:focus {
    outline: none;
    border-color: #2563eb;
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.help-text {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 8px;
}

.url-error {
    font-size: 0.85rem;
    color: #dc3545;
    margin-top: 8px;
    padding: 8px 12px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
}

.operation-section h3 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

.operation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 40px;
    margin-bottom: 40px;
}

.operation-card {
    position: relative;
    border: 2px solid #e1e5e9;
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.operation-card:hover:not(.disabled) {
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.15);
}

.operation-card.active {
    border-color: #ffffff;
    background: linear-gradient(135deg, #2979FF 0%, #1b66e7 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.operation-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #40C4FF;
}

.operation-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.operation-card label {
    cursor: pointer;
    display: block;
}

.operation-card .card-content {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.card-icon {
    font-size: 2.2rem;
    flex-shrink: 0;
    line-height: 1;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0;
    display: inline-block;
    line-height: 1.2;
}

.card-description {
    font-size: 0.9rem;
    opacity: 0.8;
}

.operation-card.active .card-description {
    opacity: 0.9;
}

.start-button {
    width: 100%;
    padding: 18px 30px;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #3c6ef7 0%, #1550f1 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(67, 56, 202, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67, 56, 202, 0.6);
}

.start-button:active {
    transform: translateY(0);
}

.start-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.result-section {
    /* margin-top: 15px; */
    padding-top: 15px;

   
}

.hidden {
    display: none;
}

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #687dad;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.podcast-info {
    background: #f8f9fa;
    border: 1px solid #abd2ff;
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
}

.podcast-header {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.podcast-image {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.podcast-details h3 {
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 8px;
}

.podcast-meta {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.podcast-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.download-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: flex-end !important;
}

.download-buttons .download-btn:first-child {
    margin-left: auto;
}

/* When there's only one button, center it on mobile */
.download-buttons:has(button:only-child) {
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .download-buttons:has(button:only-child) {
        justify-content: flex-end;
    }
}

.download-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.download-btn.primary {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.download-btn.secondary {
    background: #6c757d;
    color: white;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #f5c6cb;
    margin-top: 20px;
}

.transcript-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.transcript-available {
    background: #d4edda;
    color: #155724;
}

.transcript-unavailable {
    background: #f8d7da;
    color: #721c24;
}

.download-success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #c3e6cb;
    text-align: center;
    font-weight: 500;
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 16px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .operation-grid {
        grid-template-columns: 1fr;
    }
    
    .podcast-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .download-buttons {
        justify-content: flex-end !important;
    }
}/*
 AI Transcription Styles */
.ai-success-badge {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.cost-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.cost-info h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.cost-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.cost-item:last-child {
    border-bottom: none;
}

.cost-item.total {
    border-top: 2px solid #dee2e6;
    margin-top: 8px;
    padding-top: 12px;
    font-size: 1.1rem;
}

.transcript-preview {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.transcript-preview h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.transcript-text {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #495057;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.transcript-display {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.transcript-display h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.transcript-text-full {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #333;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.transcript-stats {
    margin-top: 10px;
    text-align: center;
    color: #6c757d;
}

.download-btn.secondary {
    background: #6c757d;
    border: 1px solid #6c757d;
}

.download-btn.secondary:hover {
    background: #5a6268;
    border-color: #5a6268;
}

/* Loading message for AI transcription */
.loading p small {
    display: block;
    margin-top: 10px;
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Operation card improvements for AI transcription */
.operation-card[data-operation="ai-transcript"] .card-icon {
    /* Removed gradient effect to fix emoji display */
}

/* Removed AI-specific styling to use consistent theme */

/* Responsive improvements */
@media (max-width: 768px) {
    .cost-breakdown {
        font-size: 0.9rem;
    }
    
    .transcript-text {
        font-size: 0.8rem;
        max-height: 150px;
    }
    
    .ai-success-badge {
        font-size: 0.9rem;
        padding: 10px 15px;
    }
}

/* Login Modal Styles */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.login-modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    font-size: 1.8rem;
    color: #2563eb;
    margin-bottom: 10px;
    font-weight: 700;
}

.login-header p {
    color: #6c757d;
    font-size: 1rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-group input:focus {
    outline: none;
    border-color: #2563eb;
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.login-error {
    color: #dc3545;
    text-align: center;
    font-size: 0.9rem;
    padding: 10px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
}

/* Header User Info Styles */
.header-top {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 10;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.user-info span {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Responsive adjustments for login modal */
@media (max-width: 768px) {
    .login-modal-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .header-top {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 20px;
        text-align: center;
    }
    
    .user-info {
        justify-content: center;
        flex-wrap: wrap;
    }
}