/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #00D9FF;
    --secondary: #8B5CF6;
    --accent: #00FF88;
    --bg-dark: #0A0E27;
    --surface-dark: #141B3E;
    --surface-light: #1E2849;
    --text-primary: #FFFFFF;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #0F1629 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.demo {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl);
}

/* ===== Language Switcher ===== */
.language-switcher {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    display: flex;
    gap: 8px;
    background: rgba(20, 27, 62, 0.9);
    backdrop-filter: blur(10px);
    padding: 8px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 217, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.lang-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.lang-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: var(--text-primary);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.4);
}

/* RTL Support */
[dir="rtl"] .language-switcher {
    left: auto;
    right: 20px;
}

/* LTR Adjustments */
[dir="ltr"] {
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

[dir="ltr"] .input-icon {
    right: auto;
    left: 16px;
}

[dir="ltr"] .input.with-icon {
    padding-right: 16px;
    padding-left: 48px;
}

[dir="ltr"] .stat-unit {
    margin-right: 0;
    margin-left: 4px;
}

[dir="ltr"] .stats-suffix {
    margin-right: 0;
    margin-left: 4px;
}

/* Header */
.demo-header {
    text-align: center;
    margin-bottom: var(--space-xl);
    padding: var(--space-xl) 0;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.logo-icon {
    font-size: 60px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.logo {
    margin-bottom: var(--space-md);
}

.gradient-text {
    font-size: 48px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 20px;
    margin: var(--space-sm) 0;
}

.description {
    color: var(--text-muted);
    font-size: 16px;
}

/* Navigation */
.demo-nav {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    justify-content: center;
}

.nav-btn {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover,
.nav-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: var(--text-primary);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
    transform: translateY(-2px);
}

/* Sections */
.demo-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.demo-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: var(--space-lg);
    border-bottom: 3px solid var(--primary);
    padding-bottom: var(--space-sm);
    display: inline-block;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 217, 255, 0.6);
}

.btn-secondary {
    background: rgba(139, 92, 246, 0.2);
    color: var(--secondary);
    border: 2px solid var(--secondary);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent), #00CC77);
    color: var(--text-primary);
}

.btn-danger {
    background: linear-gradient(135deg, #FF3366, #CC0044);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
}

.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-md { padding: 12px 24px; font-size: 16px; }
.btn-lg { padding: 16px 32px; font-size: 18px; }
.btn-full { width: 100%; }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Cards */
.card {
    background: rgba(20, 27, 62, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 217, 255, 0.2);
}

.card-glow {
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
}

.card-primary { border-color: var(--primary); }
.card-secondary { border-color: var(--secondary); }
.card-dark { background: rgba(10, 14, 39, 0.9); }

.card-header {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-header h3 {
    font-size: 20px;
    color: var(--text-primary);
}

.card-body {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.card-footer {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Layouts */
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

/* Mining Display */
.mining-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
}

.mining-visual {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mining-crystal {
    position: relative;
    width: 120px;
    height: 120px;
    animation: float 3s ease-in-out infinite;
}

.crystal-core {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    position: relative;
    z-index: 2;
}

.mining-crystal.active .crystal-core {
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.crystal-glow {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: radial-gradient(circle, rgba(0, 217, 255, 0.4) 0%, transparent 70%);
    animation: pulse 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
}

.particle-1 {
    top: 20%;
    left: 10%;
    animation: floatParticle 2s ease-in-out infinite;
}

.particle-2 {
    top: 60%;
    right: 10%;
    animation: floatParticle 2.5s ease-in-out infinite 0.3s;
}

.particle-3 {
    bottom: 20%;
    left: 50%;
    animation: floatParticle 3s ease-in-out infinite 0.6s;
}

@keyframes floatParticle {
    0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
    50% { transform: translateY(-30px) scale(1.5); opacity: 0; }
}

/* Mining Stats */
.mining-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-lg);
    width: 100%;
    text-align: center;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-unit {
    font-size: 16px;
    margin-right: 4px;
}

.stat-tier {
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
}

.stat-tier-gold {
    background: rgba(255, 215, 0, 0.2);
    color: #FFD700;
    border: 1px solid #FFD700;
}

/* Status */
.mining-status {
    width: 100%;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #64748B;
}

.status-dot.active {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.status-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Energy Bar */
.energy-bar {
    width: 100%;
}

.energy-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.energy-label {
    font-size: 16px;
    font-weight: 600;
}

.energy-value {
    font-size: 14px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.energy-track {
    height: 16px;
    background: rgba(30, 40, 73, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    overflow: hidden;
}

.energy-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--secondary));
    border-radius: 99px;
    transition: width 0.5s ease, background 0.5s ease;
    position: relative;
}

.energy-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.energy-controls {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-top: var(--space-md);
}

/* Stats Cards */
.stats-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.stats-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.stats-icon {
    font-size: 28px;
}

.stats-label {
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stats-value {
    font-size: 28px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
}

.stats-suffix {
    font-size: 14px;
    color: var(--text-secondary);
    margin-right: 4px;
}

.stats-change {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
}

.stats-change.positive {
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent);
}

.stats-change.negative {
    background: rgba(255, 51, 102, 0.15);
    color: #FF3366;
}

/* Forms */
.demo-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.input-label {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.required {
    color: #FF3366;
}

.input-container {
    position: relative;
}

.input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(30, 40, 73, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
}

.input.with-icon {
    padding-right: 48px;
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.15);
    background: rgba(30, 40, 73, 0.7);
}

.input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
}

.helper-text {
    color: var(--text-muted);
    font-size: 12px;
}

/* Footer */
.demo-footer {
    text-align: center;
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.footer-links {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    align-items: center;
}

.footer-links a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 14px;
}

.demo-footer a {
    color: var(--primary);
    text-decoration: none;
}

.demo-footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .demo {
        padding: var(--space-lg);
    }
    
    .gradient-text {
        font-size: 32px;
    }
    
    .logo-icon {
        font-size: 40px;
    }
    
    .cards-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .button-row {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .mining-visual {
        width: 150px;
        height: 150px;
    }
    
    .mining-crystal {
        width: 100px;
        height: 100px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .stats-value {
        font-size: 22px;
    }
    
    .language-switcher {
        top: 10px;
        left: 10px;
        padding: 6px;
    }
    
    [dir="rtl"] .language-switcher {
        left: auto;
        right: 10px;
    }
    
    .lang-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}
