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

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    direction: rtl;
}

/* Dashboard Container */
.dashboard-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.dashboard-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 2rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.header-content h1 {
    color: #4a5568;
    font-weight: 700;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-content h1 i {
    color: #667eea;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(72, 187, 120, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #48bb78;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-text {
    color: #48bb78;
    font-weight: 600;
    font-size: 0.9rem;
}

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

/* Navigation */
.dashboard-nav {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0 2rem;
}

.nav-tabs {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    overflow-x: auto;
}

.nav-tab {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    color: #718096;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-tab:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.nav-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

/* Main Content */
.dashboard-main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Grid Layouts */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-header h3 {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Stat Cards */
.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: #718096;
    font-weight: 500;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #4a5568;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 1);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.95rem;
}

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

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Video Preview */
.video-preview {
    background: #f7fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.preview-placeholder {
    text-align: center;
    color: #a0aec0;
}

.preview-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.video-preview video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
}

/* Progress Bar */
.progress-container {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: #718096;
    font-weight: 500;
}

/* Platform Grid */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.platform-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.5);
}

.platform-item:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.platform-item.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.platform-item i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #667eea;
}

.platform-item span {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.875rem;
}

/* File List */
.file-list {
    max-height: 400px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.file-item:hover {
    background: rgba(102, 126, 234, 0.05);
    border-color: #667eea;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.file-details h4 {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.file-details p {
    color: #718096;
    font-size: 0.875rem;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

/* Publishing Status */
.publishing-status {
    max-height: 300px;
    overflow-y: auto;
}

.status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
}

.status-platform {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.success {
    background: #c6f6d5;
    color: #22543d;
}

.status-badge.error {
    background: #fed7d7;
    color: #742a2a;
}

.status-badge.pending {
    background: #fef5e7;
    color: #744210;
}

/* Logs */
.logs-container {
    background: #1a202c;
    border-radius: 8px;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
}

.log-entry {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    display: flex;
    gap: 0.5rem;
}

.log-entry.info {
    background: rgba(66, 153, 225, 0.1);
    border-left: 3px solid #4299e1;
}

.log-entry.success {
    background: rgba(72, 187, 120, 0.1);
    border-left: 3px solid #48bb78;
}

.log-entry.error {
    background: rgba(245, 101, 101, 0.1);
    border-left: 3px solid #f56565;
}

.log-entry.warning {
    background: rgba(237, 137, 54, 0.1);
    border-left: 3px solid #ed8936;
}

.log-time {
    color: #a0aec0;
    font-size: 0.875rem;
    min-width: 100px;
}

.log-message {
    color: #e2e8f0;
    flex: 1;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.loading-spinner i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.loading-spinner p {
    color: #4a5568;
    font-weight: 600;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
}

.toast {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
    position: relative;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--error-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.toast.info {
    border-left: 4px solid var(--primary-color);
}

.toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    color: var(--text-primary);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Voice Selection Container */
.voice-selection-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.voice-selection-container select {
    flex: 1;
}

.voice-selection-container .btn {
    white-space: nowrap;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.3s ease-out;
}

.modal-container {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Voice Settings */
.voice-settings {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.setting-item label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-range {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.form-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.form-range::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.range-value {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    min-width: 30px;
}

/* Voice Preview */
.voice-preview {
    margin-top: 20px;
    padding: 15px;
    background: var(--hover-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.voice-preview h4 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 16px;
}

.voice-preview audio {
    width: 100%;
    margin-top: 10px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* API Key Management Styles */
.api-keys-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.api-key-item {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.api-key-input.has-key {
    background-color: #e8f5e8;
    border-color: #28a745;
    color: #155724;
}

.api-key-input.has-key::placeholder {
    color: #28a745;
    font-weight: 500;
}

.api-key-input:not(.has-key) {
    background-color: #fff3cd;
    border-color: #ffc107;
}

.api-key-input:not(.has-key)::placeholder {
    color: #856404;
    font-style: italic;
}

.api-key-item:hover {
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.api-key-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.api-key-info i {
    font-size: 1.2rem;
    color: #667eea;
    width: 20px;
    text-align: center;
}

.api-key-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 1.1rem;
}

.api-key-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.api-key-controls {
    margin-top: 1rem;
}

.api-key-input {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.api-key-input:focus {
    background: white;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.input-group {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.input-group .form-control {
    border-radius: 0;
    border-right: none;
    flex: 1;
}

.input-group-append {
    display: flex;
}

.input-group-append .btn {
    border-radius: 0;
    border-left: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.input-group-append .btn:first-child {
    border-left: none;
}

.input-group-append .btn:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.toggle-visibility {
    background: #f7fafc;
    color: #718096;
    border: 1px solid #e2e8f0;
}

.toggle-visibility:hover {
    background: #edf2f7;
    color: #4a5568;
}

.verify-key {
    background: #ebf8ff;
    color: #3182ce;
    border: 1px solid #bee3f8;
}

.verify-key:hover {
    background: #bee3f8;
    color: #2c5282;
}

.save-key {
    background: #f0fff4;
    color: #38a169;
    border: 1px solid #9ae6b4;
}

.save-key:hover {
    background: #9ae6b4;
    color: #276749;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-indicator.valid {
    background: rgba(72, 187, 120, 0.1);
    color: #38a169;
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.status-indicator.invalid {
    background: rgba(245, 101, 101, 0.1);
    color: #e53e3e;
    border: 1px solid rgba(245, 101, 101, 0.3);
}

.status-indicator.loading {
    background: rgba(66, 153, 225, 0.1);
    color: #3182ce;
    border: 1px solid rgba(66, 153, 225, 0.3);
}

.status-indicator.missing {
    background: rgba(237, 137, 54, 0.1);
    color: #dd6b20;
    border: 1px solid rgba(237, 137, 54, 0.3);
}

.status-indicator i {
    font-size: 0.8rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.api-info {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.info-section, .backup-section {
    margin-bottom: 1.5rem;
}

.info-section h5, .backup-section h5 {
    color: #4a5568;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    padding: 0.5rem 0;
    color: #718096;
    position: relative;
    padding-right: 1.5rem;
}

.info-list li:before {
    content: '✓';
    position: absolute;
    right: 0;
    color: #38a169;
    font-weight: bold;
}

.backup-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.backup-section .btn {
    align-self: flex-start;
}

/* Loading states */
.api-key-item.loading {
    opacity: 0.7;
    pointer-events: none;
}

.api-key-item.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

/* Success/Error animations */
@keyframes successPulse {
    0% { box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(72, 187, 120, 0); }
    100% { box-shadow: 0 0 0 0 rgba(72, 187, 120, 0); }
}

@keyframes errorPulse {
    0% { box-shadow: 0 0 0 0 rgba(245, 101, 101, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(245, 101, 101, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 101, 101, 0); }
}

.api-key-item.success {
    animation: successPulse 1s;
    border-color: #38a169;
}

.api-key-item.error {
    animation: errorPulse 1s;
    border-color: #e53e3e;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header-content h1 {
        font-size: 1.5rem;
    }
    
    .dashboard-nav {
        padding: 0 1rem;
    }
    
    .nav-tabs {
        justify-content: flex-start;
    }
    
    .nav-tab {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .dashboard-main {
        padding: 1rem;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .platform-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .toast-container {
        top: 1rem;
        left: 1rem;
        right: 1rem;
    }
    
    .toast {
        max-width: none;
    }
    
    /* API Key Management Mobile Styles */
    .api-key-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .card-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .card-actions .btn {
        width: 100%;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group .form-control {
        border-radius: 8px;
        border: 1px solid #e2e8f0;
        margin-bottom: 0.5rem;
    }
    
    .input-group-append {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .input-group-append .btn {
        border-radius: 8px;
        border: 1px solid #e2e8f0;
    }
    
    .backup-section {
        flex-direction: column;
    }
    
    .backup-section .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 1.25rem;
    }
    
    .nav-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .stat-content h3 {
        font-size: 1.5rem;
    }
}

/* Toast Buttons */
.toast-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.toast-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 0.5rem;
}

.toast-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
}

.toast-copy-btn {
    color: #667eea;
}

.toast-copy-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #5a67d8;
}

.toast-close-btn {
    color: #718096;
}

.toast-close-btn:hover {
    background: rgba(113, 128, 150, 0.1);
    color: #4a5568;
}

/* Log Entry Buttons */
.log-entry {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.25rem;
    transition: background-color 0.2s ease;
}

.log-entry:hover {
    background: rgba(255, 255, 255, 0.05);
}

.log-copy-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #a0aec0;
    font-size: 0.75rem;
    opacity: 0;
    margin-right: 0.5rem;
}

.log-entry:hover .log-copy-btn {
    opacity: 1;
}

.log-copy-btn:hover {
    background: rgba(160, 174, 192, 0.2);
    color: #e2e8f0;
}

/* Temporary toast for copy confirmation */
.temp-toast {
    animation: tempToastSlide 2s ease;
}

@keyframes tempToastSlide {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    10%, 90% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-100%);
        opacity: 0;
    }
}

/* API Status Indicators */
.api-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.api-status.configured {
    background: rgba(72, 187, 120, 0.1);
    color: #48bb78;
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.api-status.not-configured {
    background: rgba(245, 101, 101, 0.1);
    color: #f56565;
    border: 1px solid rgba(245, 101, 101, 0.3);
}

/* Enhanced input styling for API keys */
.form-group {
    position: relative;
    margin-bottom: 1rem;
}

.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.form-group input[type="password"]:focus,
.form-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input[type="password"]::placeholder,
.form-group input[type="text"]::placeholder {
    color: #a0aec0;
    font-style: italic;
}

/* API Status Container */
.api-status-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.api-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.api-status-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.api-status-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #e2e8f0;
}

.api-status-label i {
    color: #667eea;
    font-size: 1.1rem;
}

.api-status-value {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.status-indicator.configured {
    background: rgba(72, 187, 120, 0.15);
    color: #68d391;
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.status-indicator.not-configured {
    background: rgba(245, 101, 101, 0.15);
    color: #fc8181;
    border: 1px solid rgba(245, 101, 101, 0.3);
}

.status-indicator.loading {
    background: rgba(237, 137, 54, 0.15);
    color: #ed8936;
    border: 1px solid rgba(237, 137, 54, 0.3);
}

.api-key-preview {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #a0aec0;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.api-info {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    border-right: 4px solid #667eea;
}

.api-info p {
    margin: 0;
    color: #cbd5e0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.api-info i {
    color: #667eea;
    margin-left: 0.5rem;
}

/* Script Preview Styles */
.script-preview-container {
    margin-top: 1rem;
}

.script-preview {
    background: rgba(248, 250, 252, 0.8);
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    min-height: 200px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.script-preview:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.script-preview.has-content {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #e2e8f0;
    border-color: #48bb78;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #a0aec0;
    text-align: center;
}

.preview-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #cbd5e0;
}

.preview-placeholder p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
}

.script-content {
    color: #2d3748;
    line-height: 1.6;
    font-size: 1rem;
}

.script-segment {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-right: 4px solid #667eea;
    transition: all 0.3s ease;
}

.script-segment:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateX(-2px);
}

.segment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #667eea;
    font-weight: 600;
}

.segment-duration {
    background: rgba(102, 126, 234, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

.segment-text {
    color: #2d3748;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.segment-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.keyword-tag {
    background: rgba(72, 187, 120, 0.1);
    color: #48bb78;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.script-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-start;
}

.script-actions .btn {
    min-width: 120px;
}

.script-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #667eea;
}

.script-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.script-stat i {
    color: #667eea;
}

/* Topic Input Enhancement */
#videoTopic {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#videoTopic:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 1);
}

#videoTopic::placeholder {
    color: #a0aec0;
    font-style: italic;
}

/* Loading States */
.script-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #667eea;
}

.script-loading i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.script-loading p {
    margin: 0;
    font-weight: 500;
}

/* Error States */
.script-error {
    background: rgba(245, 101, 101, 0.1);
    border: 2px solid rgba(245, 101, 101, 0.3);
    color: #f56565;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.script-error i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Voice Provider Status Styles */
.voice-provider-status {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(247, 250, 252, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.provider-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.4);
}

.provider-status:last-child {
    border-bottom: none;
}

.provider-status.available {
    color: #2d3748;
}

.provider-status.unavailable {
    color: #718096;
}

.provider-name {
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator.success {
    color: #48bb78;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-indicator.error {
    color: #f56565;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-indicator.loading {
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.voice-selection-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.voice-selection-container .form-control {
    flex: 1;
    min-width: 200px;
}

.voice-selection-container .btn {
    white-space: nowrap;
}

/* Facebook Scheduling Styles */
.facebook-scheduling {
    background: rgba(24, 119, 242, 0.05);
    border: 2px solid rgba(24, 119, 242, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.facebook-scheduling:hover {
    background: rgba(24, 119, 242, 0.08);
    border-color: rgba(24, 119, 242, 0.2);
}

.scheduling-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: #1877f2;
    font-weight: 600;
    font-size: 1.1rem;
}

.scheduling-header i {
    font-size: 1.3rem;
    color: #1877f2;
}

.scheduling-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(24, 119, 242, 0.2);
    transition: all 0.3s ease;
}

.form-check:hover {
    background: rgba(255, 255, 255, 0.8);
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #1877f2;
    cursor: pointer;
}

.form-check-label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    color: #2d3748;
}

.scheduling-datetime {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(24, 119, 242, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.scheduling-datetime .row {
    display: flex;
    gap: 1rem;
    margin: 0;
}

.scheduling-datetime .col-md-6 {
    flex: 1;
    padding: 0;
}

.scheduling-datetime label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
}

.scheduling-datetime input[type="date"],
.scheduling-datetime input[type="time"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.scheduling-datetime input[type="date"]:focus,
.scheduling-datetime input[type="time"]:focus {
    outline: none;
    border-color: #1877f2;
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.1);
    background: white;
}

.scheduling-datetime .form-text {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scheduling-datetime .form-text i {
    color: #1877f2;
}

/* Responsive Design for Scheduling */
@media (max-width: 768px) {
    .scheduling-datetime .row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .facebook-scheduling {
        padding: 1rem;
    }
    
    .scheduling-header {
        font-size: 1rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: #718096; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }