/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    flex: 1;
    margin-bottom: 20px;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.header h1 {
    margin-bottom: 0.5rem;
    font-size: 2.2em;
}

.header p {
    opacity: 0.9;
    font-size: 1.1em;
}

/* Content Area */
.content {
    padding: 2rem;
}

/* Info Banner */
.info-banner {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.info-banner p {
    margin: 0;
    font-size: 1rem;
    color: #333;
}

.info-banner a {
    color: #667eea;
    text-decoration: underline;
    font-weight: 600;
}

.info-banner a:hover {
    color: #5a6fd8;
}

/* Form Elements */
.input-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

input[type="url"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="url"]:focus {
    outline: none;
    border-color: #667eea;
}

textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 150px;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Button Styles */
.button-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

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

.btn-secondary:hover {
    background: #545b62;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

/* Loading Animation */
.loading {
    display: none;
    text-align: center;
    margin: 1.5rem 0;
    color: #666;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

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

/* Credits Counter */
.credits-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.rate-limit-ok {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.rate-limit-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.rate-limit-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.rate-limit-disabled {
    background: #e2e3e5;
    color: #6c757d;
    border: 1px solid #d6d8db;
}

/* Summary Section */
.summary-container {
    display: none;
    margin-top: 2rem;
    border-top: 1px solid #eee;
    padding-top: 2rem;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.summary-content {
    background: #f0f8ff;
    border: 1px solid #bee5eb;
    border-radius: 6px;
    padding: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.8;
}

.transcript-controls {
    display: flex;
    gap: 0.5rem;
}

/* Messages */
.error {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 6px;
    margin: 1.5rem 0;
    border-left: 4px solid #dc3545;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin: 0.75rem 0;
    font-size: 0.9rem;
}

/* Proxy Status */
.proxy-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.7;
    z-index: 1000;
    transition: opacity 0.3s;
}

.proxy-status:hover {
    opacity: 1;
}

.proxy-enabled {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.proxy-disabled {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.proxy-icon {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

/* Footer */
.footer {
    background: #343a40;
    color: white;
    padding: 2rem 0;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: #667eea;
}

.footer-section p,
.footer-section a {
    color: #adb5bd;
    text-decoration: none;
    line-height: 1.6;
}

.footer-section a:hover {
    color: white;
    text-decoration: underline;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-bottom {
    border-top: 1px solid #495057;
    margin-top: 2rem;
    padding-top: 1rem;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }
    
    .container {
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }
    
    .header {
        padding: 1.5rem;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .content {
        padding: 1.5rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    button {
        flex: none;
        width: 100%;
    }
    
    .summary-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .transcript-controls {
        justify-content: center;
    }
    
    .credits-counter {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .proxy-status {
        bottom: 10px;
        right: 10px;
        padding: 0.25rem;
    }
    
    textarea {
        min-height: 120px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5em;
    }
    
    .header p {
        font-size: 1em;
    }
    
    .content {
        padding: 1rem;
    }
    
    button {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .summary-content {
        padding: 1rem;
    }
    
    .footer {
        padding: 1.5rem 0;
    }
}

/* Print Styles */
@media print {
    .proxy-status,
    .loading,
    .button-group,
    .footer {
        display: none !important;
    }
    
    .container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .header {
        background: #333 !important;
        -webkit-print-color-adjust: exact;
    }
}

/* Timestamp Controls */
.timestamp-controls {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.timestamp-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.timestamp-toggle input[type="checkbox"] {
    margin: 0;
    margin-right: 0.75rem;
    transform: scale(1.2);
    cursor: pointer;
}

.timestamp-toggle:hover {
    color: #007bff;
}

.timestamp-controls .form-text {
    margin-left: 2rem;
    color: #6c757d;
    font-size: 0.875rem;
}