/* Common styles for all pages */
/* ============================= */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* HTML and body for proper mobile height */
html {
    height: 100%;
    background-color: #0a0a0a;
}

/* Body styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #0a0a0a;
    color: #e0e0e0;
    padding: 20px;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1600px;
    margin: 20px auto 0;
    width: 100%;
}

/* Header styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
}

.header h1 {
    font-size: 28px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Button styles */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 100%);
    color: #000;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffc107;
    color: #000;
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

.btn-success {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

/* Card styles */
.card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #1a1a1a;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.7);
    border: 1px solid #2a2a2a;
}

.modal-header {
    background: #111;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2a2a2a;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    background: #111;
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #2a2a2a;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #fff;
}

/* Form elements */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
    background: #222;
    border: 1px solid #333;
    color: #e0e0e0;
    padding: 10px;
    border-radius: 6px;
    width: 100%;
    font-size: 14px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #ff6b6b;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #aaa;
    font-size: 14px;
}

/* Loader animation */
.loader {
    border: 3px solid #333;
    border-top: 3px solid #ff6b6b;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Status badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.status-processing {
    background: rgba(0, 123, 255, 0.2);
    color: #007bff;
}

.status-completed {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.status-failed {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #888;
}

.empty-state p {
    font-size: 14px;
    color: #666;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
}

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

/* Animation classes */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Responsive media queries */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        margin: 10px auto 0;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

/* Utility classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-10 {
    padding: 10px;
}

.p-20 {
    padding: 20px;
}

.hidden {
    display: none;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}

/* Layout classes for page structure */
.layout-grid {
    display: block;
    width: 100%;
}

.main-column {
    width: 100%;
}

/* Panel and section styles */
.panel-card {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid #2a2a2a;
}

.dev-section,
.training-section,
.console-section,
.statistics-section,
.concepts-section {
    padding: 20px;
}

/* Settings grid layout */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

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

.setting-item label {
    display: block;
    color: #888;
    margin-bottom: 8px;
    font-size: 14px;
}

.setting-item input[type="range"] {
    width: 100%;
}

.setting-item input[type="number"],
.setting-item input[type="text"],
.setting-item select {
    background: #0a0a0a;
    color: #fff;
    border: 1px solid #333;
    padding: 8px;
    border-radius: 6px;
    width: 100%;
}

.setting-value {
    color: #fff;
    margin-top: 5px;
}

/* Proxy selection styles */
.proxy-selection {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 15px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.radio-label:hover {
    border-color: #ffd93d;
    background: #111;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #ffd93d;
    cursor: pointer;
}

.radio-label input[type="radio"]:checked + .radio-text {
    color: #ffd93d;
}

.radio-text {
    color: #ccc;
    font-size: 14px;
}

.proxy-status {
    margin-top: 15px;
    padding: 12px 15px;
    background: #111;
    border-radius: 6px;
    font-size: 14px;
}

/* Page headings */
.page-heading {
    color: #fff;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 600;
}

.section-heading {
    color: #ffd93d;
    margin-bottom: 20px;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Actions grid layout */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* API settings grid (single column) */
.api-settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

/* System info text */
.system-info-text {
    color: #888;
}

.system-info-text p {
    margin-bottom: 10px;
}

.system-info-value {
    color: #4ecdc4;
}

/* Statistics page styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    color: #fff;
}

.stat-value.primary {
    color: #4ecdc4;
}

.stat-value.secondary {
    color: #ffd93d;
}

.stat-value.success {
    color: #4CAF50;
}

.stat-value.danger {
    color: #ff6b6b;
}

.stat-label {
    color: #888;
    margin-top: 5px;
    font-size: 14px;
}

/* API Usage styles */
.api-usage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.api-service h4 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 16px;
}

.api-details {
    background: #0a0a0a;
    padding: 15px;
    border-radius: 8px;
}

.api-details p {
    color: #888;
    margin: 5px 0;
}

.api-value {
    color: #4ecdc4;
}

.api-cost {
    color: #4CAF50;
}

/* Chart container */
.chart-container {
    height: 300px;
    color: #888;
}

/* Console page styles */
.console-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.console-controls select,
.console-controls input[type="text"] {
    background: #0a0a0a;
    color: #fff;
    border: 1px solid #333;
    padding: 8px;
    border-radius: 6px;
}

.console-controls input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.console-output-container {
    background: #0a0a0a;
    border-radius: 12px;
    padding: 20px;
    height: 600px;
    overflow-y: auto;
}

.console-output {
    color: #e0e0e0;
    font-family: 'Consolas', 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    margin: 0;
    white-space: pre-wrap;
}

.console-stats {
    display: flex;
    gap: 30px;
    color: #888;
    font-size: 14px;
}

.console-stats span {
    color: #888;
}

.console-error-count {
    color: #ff6b6b;
}

.console-warning-count {
    color: #ffa726;
}

.console-info-count {
    color: #66bb6a;
}

.console-debug-count {
    color: #888;
}