/**
 * NecroNetAI Support Page Styles
 * Dark theme with icy blue accents
 */

/* CSS Variables */
:root {
    --color-bg: #000000;
    --color-surface: rgba(10, 15, 20, 0.85);
    --color-surface-hover: rgba(15, 22, 30, 0.9);
    --color-border: rgba(168, 200, 212, 0.1);
    --color-border-active: rgba(168, 200, 212, 0.3);
    --color-text: #e8f4f8;
    --color-text-muted: rgba(200, 220, 230, 0.7);
    --color-accent: #a8c8d4;
    --color-accent-light: #c8e0e8;
    --color-glow: rgba(168, 200, 212, 0.4);
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* WebGL Background */
#webgl-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#binary-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#cloth-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    opacity: 0.6;
}

#cloth-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Main Content */
.content {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header */
.header {
    text-align: center;
    padding: 3rem 1rem 2rem;
    max-width: 800px;
    animation: fadeInDown 1s ease-out;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--color-accent);
}

.logo-icon {
    font-size: 1.5rem;
    animation: pulse 2s ease-in-out infinite;
}

.title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 300;
    line-height: 1.4;
    letter-spacing: 1px;
    text-shadow: 0 0 30px var(--color-glow);
}

.title-accent {
    display: block;
    font-weight: 500;
    color: var(--color-accent-light);
    margin-top: 0.5rem;
}

/* Tabs Navigation */
.tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    max-width: 800px;
    width: 100%;
}

.tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text-muted);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
}

.tab:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-border-active);
    color: var(--color-text);
    transform: translateY(-2px);
}

.tab.active {
    background: rgba(168, 200, 212, 0.15);
    border-color: var(--color-accent);
    color: var(--color-accent-light);
    box-shadow: 0 0 20px var(--color-glow);
}

/* Iran Tab - Special Styling */
.tab.iran-tab {
    background: linear-gradient(135deg, rgba(0, 150, 100, 0.15), rgba(0, 100, 150, 0.15));
    border-color: rgba(0, 200, 150, 0.3);
}

.tab.iran-tab:hover {
    background: linear-gradient(135deg, rgba(0, 200, 130, 0.25), rgba(0, 130, 180, 0.25));
    border-color: rgba(0, 220, 170, 0.5);
}

.tab.iran-tab.active {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.2), rgba(0, 150, 200, 0.2));
    border-color: #00d4aa;
    color: #00d4aa;
    box-shadow: 0 0 25px rgba(0, 212, 170, 0.4);
}

.tab-icon {
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

.tab.active .tab-icon {
    opacity: 1;
}

/* Tab Content */
.tab-content-wrapper {
    width: 100%;
    max-width: 800px;
    perspective: 1000px;
}

.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.tab-content.active {
    display: block;
    animation: fadeInUp 0.5s ease-out forwards;
}

.tab-content.fade-out {
    animation: fadeOutDown 0.3s ease-out forwards;
}

.content-inner {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(20px);
}

/* Content Typography */
.content-inner h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--color-accent-light);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
}

.section {
    margin-bottom: 2rem;
}

.section:last-child {
    margin-bottom: 0;
}

.section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.section p {
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

/* Steps List */
.steps {
    list-style: none;
    counter-reset: step-counter;
}

.steps li {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border-left: 3px solid var(--color-border);
    transition: all var(--transition-normal);
}

.steps li:hover {
    border-left-color: var(--color-accent);
    background: rgba(168, 200, 212, 0.05);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--color-accent);
    color: var(--color-bg);
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

.step-content strong {
    display: block;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.step-content p {
    margin: 0;
    font-size: 0.9rem;
}

/* Tips List */
.tips {
    list-style: none;
    padding-left: 0;
}

.tips li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.tips li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--color-accent);
}

/* ========================
   Recommended & Alternative Sections
   ======================== */
.recommended-section {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(139, 195, 74, 0.05) 100%);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.recommended-section h3 {
    color: #81c784;
}

.recommended-section .step-number {
    background: #4caf50;
}

.recommended-section .steps li:hover {
    border-left-color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
}

.method-badge {
    display: inline-block;
    background: rgba(76, 175, 80, 0.2);
    color: #a5d6a7;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.alternative-section {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.08) 0%, rgba(255, 193, 7, 0.03) 100%);
    border: 1px solid rgba(255, 152, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
}

.alternative-section h3 {
    color: #ffb74d;
}

.alternative-section .step-number {
    background: #ff9800;
}

.alternative-section .steps li:hover {
    border-left-color: #ff9800;
    background: rgba(255, 152, 0, 0.1);
}

/* Code Blocks */
code {
    font-family: var(--font-mono);
    background: rgba(168, 200, 212, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: var(--color-accent);
    font-size: 0.9em;
}

.code-block {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    margin: 0.75rem 0;
    overflow-x: auto;
}

.code-block code {
    background: transparent;
    padding: 0;
    color: var(--color-accent-light);
    display: block;
    white-space: pre;
}

/* Organization Name Highlight */
.org-name {
    background: rgba(76, 175, 80, 0.2) !important;
    color: #81c784 !important;
    font-weight: 600;
    padding: 0.2rem 0.5rem !important;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

/* Links */
a {
    color: var(--color-accent-light);
    text-decoration: none;
    transition: all var(--transition-fast);
}

a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

/* Download Button */
.download-btn {
    display: inline-block;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2) 0%, rgba(139, 195, 74, 0.1) 100%);
    color: #81c784 !important;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(76, 175, 80, 0.3);
    font-weight: 500;
    text-decoration: none !important;
    transition: all var(--transition-normal);
}

.download-btn:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3) 0%, rgba(139, 195, 74, 0.2) 100%);
    border-color: rgba(76, 175, 80, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

/* Footer - see bottom of file for updated styles */

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 10px var(--color-glow);
    }
    50% {
        box-shadow: 0 0 25px var(--color-glow), 0 0 40px var(--color-glow);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .content {
        padding: 1rem;
    }
    
    .header {
        padding: 2rem 0.5rem 1.5rem;
    }
    
    .tabs {
        gap: 0.375rem;
        padding: 0.5rem;
    }
    
    .tab {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .tab-icon {
        width: 16px;
        height: 16px;
    }
    
    .content-inner {
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .content-inner h2 {
        font-size: 1.25rem;
    }
    
    .steps li {
        padding: 0.75rem;
    }
    
    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .tabs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tab {
        justify-content: center;
    }
    
    .content-inner {
        padding: 1rem;
    }
    
    .steps li {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus States */
.tab:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.tab:focus:not(:focus-visible) {
    outline: none;
}

/* Selection */
::selection {
    background: var(--color-accent);
    color: var(--color-bg);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border-active);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

/* ========================
   Language Selector
   ======================== */
.lang-selector {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    backdrop-filter: blur(10px);
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    border-radius: 4px;
}

.lang-btn:hover {
    color: var(--color-text);
    background: rgba(168, 200, 212, 0.1);
}

.lang-btn.active {
    color: var(--color-accent-light);
    background: rgba(168, 200, 212, 0.15);
}

.lang-divider {
    color: var(--color-border-active);
    font-size: 0.8rem;
}

/* ========================
   Language Content Visibility
   ======================== */
.lang-content {
    display: none !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal);
}

.lang-content.active {
    display: block !important;
    opacity: 1;
    visibility: visible;
}

/* Ensure only active language is shown in content-inner */
.content-inner .lang-content:not(.active) {
    display: none !important;
    height: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

/* ========================
   RTL Support for Persian
   ======================== */
html.rtl {
    direction: rtl;
}

.rtl-content {
    direction: rtl;
    text-align: right;
    font-family: 'Vazirmatn', var(--font-sans);
}

/* RTL Content Inner */
.rtl-content .content-inner {
    direction: rtl;
    text-align: right;
}

.rtl-content h2,
.rtl-content h3 {
    text-align: right;
    width: 100%;
}

.rtl-content .section {
    direction: rtl;
    text-align: right;
    width: 100%;
}

.rtl-content .section p {
    direction: rtl;
    text-align: right;
    width: 100%;
}

/* RTL Steps */
.rtl-content .steps {
    direction: rtl;
    text-align: right;
}

.rtl-content .steps li {
    flex-direction: row-reverse;
    text-align: right;
    width: 100%;
}

.rtl-content .step-content {
    text-align: right;
    direction: rtl;
    width: 100%;
}

.rtl-content .step-content strong {
    display: block;
    text-align: right;
    width: 100%;
}

.rtl-content .step-content p {
    text-align: right;
    direction: rtl;
    width: 100%;
}

/* RTL Tips */
.rtl-content .tips {
    direction: rtl;
    text-align: right;
}

.rtl-content .tips li {
    padding-left: 0;
    padding-right: 1.5rem;
    text-align: right;
    direction: rtl;
}

.rtl-content .tips li::before {
    left: auto;
    right: 0;
    content: '←';
}

/* Keep code/paths LTR in RTL context */
.rtl-content code,
.rtl-content .no-translate {
    direction: ltr;
    display: inline-block;
    unicode-bidi: embed;
    font-family: var(--font-mono);
    background: rgba(168, 200, 212, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    color: var(--color-accent);
    margin: 0 0.25rem;
}

/* Persian-specific adjustments */
body.lang-fa .header,
body.lang-fa .tabs,
body.lang-fa .footer {
    direction: ltr;
    text-align: center;
}

/* Language selector always stays on right */
body.lang-fa .lang-selector {
    right: 1.5rem;
    left: auto;
}

/* ========================
   Footer Styles (Updated)
   ======================== */
.footer {
    margin-top: auto;
    padding: 2rem;
    text-align: center;
}

.footer-brand {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-accent-light);
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.footer-org {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.footer-org-fa {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-family: 'Vazirmatn', var(--font-sans);
    display: none;
    direction: rtl;
}

body.lang-fa .footer-org {
    display: none;
}

body.lang-fa .footer-org-fa {
    display: block;
}

/* ========================
   Responsive Adjustments
   ======================== */
@media (max-width: 768px) {
    .lang-selector {
        top: 1rem;
        right: 1rem;
        padding: 0.4rem 0.6rem;
    }
    
    .lang-btn {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }
}

@media (max-width: 480px) {
    .lang-selector {
        top: 0.75rem;
        right: 0.75rem;
        gap: 0.3rem;
        padding: 0.3rem 0.5rem;
    }
}

/* Language selector ALWAYS stays on the right - never move it */
html[dir="rtl"] .lang-selector,
body.lang-fa .lang-selector {
    right: 1.5rem !important;
    left: auto !important;
}

@media (max-width: 768px) {
    html[dir="rtl"] .lang-selector,
    body.lang-fa .lang-selector {
        right: 1rem !important;
        left: auto !important;
    }
}

@media (max-width: 480px) {
    html[dir="rtl"] .lang-selector,
    body.lang-fa .lang-selector {
        right: 0.75rem !important;
        left: auto !important;
    }
}
