/**
 * OpenInterest Guide - Common CSS
 * @author Coco & Jake
 * @since 2025-01-26
 */

/* CSS Variables */
:root {
    --primary-color: #4CAF50;
    --primary-gold: #FFD700;
    --bg-primary: #1a1a1a;
    --bg-secondary: #242424;
    --bg-tertiary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #999999;
    --border-color: #444444;
    --sidebar-width: 260px;
    --header-height: 60px;
    --gradient-primary: linear-gradient(135deg, #FFD700, #FFA500);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Guide Wrapper */
.guide-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
    background-color: var(--bg-primary);
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    padding: 30px 20px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-gold);
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
}

.sidebar-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Language Selector */
.language-selector {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.language-selector .form-select {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 8px;
    width: 100%;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 30px;
}

.nav-section-title {
    padding: 0 20px 10px;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
}

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

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    display: block;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background-color: rgba(255, 215, 0, 0.1);
    padding-left: 25px;
}

.nav-link.active {
    color: var(--primary-gold);
    background-color: rgba(255, 215, 0, 0.15);
    border-left: 3px solid var(--primary-gold);
}

.nav-link i {
    width: 20px;
    margin-right: 10px;
}

/* Sidebar Footer */
.sidebar-footer {
    position: sticky;
    bottom: 0;
    padding: 20px;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--bg-primary);
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
}

/* Page Title */
.content-wrapper > h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* Mobile Toggle Button */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background-color: var(--bg-secondary);
}

.hamburger {
    width: 20px;
    height: 16px;
    position: relative;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    position: absolute;
    left: 0;
    transition: all 0.3s ease;
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 7px; }
.hamburger span:nth-child(3) { bottom: 0; }

.sidebar-toggle.active .hamburger span:nth-child(1) {
    transform: rotate(45deg);
    top: 7px;
}

.sidebar-toggle.active .hamburger span:nth-child(2) {
    opacity: 0;
}

.sidebar-toggle.active .hamburger span:nth-child(3) {
    transform: rotate(-45deg);
    bottom: 7px;
}

/* Content Sections */
.content-section {
    background-color: var(--bg-secondary);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.content-section h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-section h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.content-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 15px;
}

/* Navigation Buttons */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin: 50px 0 30px 0;
    gap: 20px;
}

.btn-nav {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-prev {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-prev:hover {
    background: var(--bg-secondary);
    transform: translateX(-5px);
    color: var(--text-primary);
}

.btn-next {
    background: var(--primary-gold);
    color: #000;
    font-weight: bold;
}

.btn-next:hover {
    background: #FFA500;
    transform: translateX(5px);
    color: #000;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-wrapper {
        padding: 20px;
    }
    
    .navigation-buttons {
        flex-direction: column;
    }
}

/* Earnings Page Specific Styles */
.earnings-hero {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 140, 0, 0.05) 100%);
    border-radius: 20px;
    padding: 50px;
    margin-bottom: 50px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.earnings-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.earnings-title {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.earnings-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.earnings-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.stat-card {
    background: var(--bg-tertiary);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-gold);
}

/* Process Timeline */
.process-timeline {
    position: relative;
    padding: 20px 0;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 40px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 35px;
    top: 60px;
    bottom: -40px;
    width: 2px;
    background: var(--border-color);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-number {
    width: 50px;
    height: 50px;
    background: var(--primary-gold);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-right: 30px;
    position: relative;
    z-index: 1;
}

.timeline-content {
    flex: 1;
    background: var(--bg-tertiary);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid var(--border-color);
}

.timeline-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.timeline-description {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Daily Settlement Feature */
.feature-benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.benefit-item:hover {
    border-color: rgba(255, 215, 0, 0.3);
    transform: translateX(5px);
}

.benefit-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.benefit-text strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.benefit-text p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Referral Structure */
.referral-structure {
    background: var(--bg-tertiary);
    border-radius: 20px;
    padding: 40px;
    margin: 30px 0;
    position: relative;
    overflow: hidden;
}

.referral-structure::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.level-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.level-card:hover {
    border-color: var(--primary-gold);
    transform: translateY(-5px);
}

.level-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: var(--primary-gold);
    color: #000;
    border-radius: 50%;
    line-height: 40px;
    font-weight: 700;
    margin-bottom: 15px;
}

.level-name {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.level-bonus {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-gold);
}

/* Important Notes */
.important-notes {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    padding: 25px;
    margin: 30px 0;
}

.important-notes h3 {
    color: var(--primary-gold);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.important-notes ul {
    list-style: none;
    padding: 0;
}

.important-notes li {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
    color: var(--text-secondary);
}

.important-notes li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-gold);
    font-weight: 700;
}

/* FAQ Accordion */
.faq-item {
    background: var(--bg-tertiary);
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.faq-question {
    padding: 20px 25px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.faq-question:hover {
    background: rgba(255, 215, 0, 0.05);
}

.faq-question h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.faq-toggle {
    color: var(--primary-gold);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-toggle {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 25px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    padding: 0 25px 25px;
    max-height: 500px;
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Utilities */
.text-gold {
    color: var(--primary-gold) !important;
}

.bg-gold {
    background-color: var(--primary-gold) !important;
    color: #000 !important;
}

.border-gold {
    border-color: var(--primary-gold) !important;
}

/* Image Gallery Styles */
.guide-image-container {
    margin: 20px 0;
    text-align: center;
}

.guide-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.guide-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.2);
}

.image-caption {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Links */
a {
    color: var(--primary-gold);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #FFA500;
    text-decoration: underline;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-gold);
    color: #000;
}

.btn-primary:hover {
    background: #FFA500;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-gold);
    border: 2px solid var(--primary-gold);
}

.btn-outline-primary:hover {
    background: var(--primary-gold);
    color: #000;
}

/* Form Elements */
.form-control,
.form-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

/* Tables */
.table {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
}

.table tr:hover {
    background: rgba(255, 215, 0, 0.05);
}

/* Code Blocks */
.code-block {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    font-family: 'Consolas', 'Monaco', monospace;
    overflow-x: auto;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid;
}

.alert-info {
    background: rgba(33, 150, 243, 0.1);
    border-color: #2196F3;
    color: #2196F3;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border-color: #4CAF50;
    color: #4CAF50;
}

.alert-warning {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--primary-gold);
    color: var(--primary-gold);
}

.alert-danger {
    background: rgba(244, 67, 54, 0.1);
    border-color: #F44336;
    color: #F44336;
}

/* ASCII Art Banner */
.ascii-art-banner {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    margin: 40px 0;
    text-align: center;
    overflow: hidden;
    position: relative;
}

.ascii-art-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 215, 0, 0.03) 50%,
        transparent 70%
    );
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.ascii-art-content {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.2;
    color: #0099cc;
    white-space: pre;
    overflow: visible;
    margin: 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    display: inline-block;
    position: relative;
    z-index: 1;
    transform-origin: center center;
    transform: scale(1);
    transition: transform 0.3s ease;
}

.ascii-art-version {
    margin-top: 20px;
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Responsive ASCII Art with Scale */
@media (max-width: 1400px) {
    .ascii-art-content {
        transform: scale(0.9);
    }
}

@media (max-width: 1200px) {
    .ascii-art-content {
        transform: scale(0.8);
    }
}

@media (max-width: 992px) {
    .ascii-art-content {
        transform: scale(0.6);
    }
    .ascii-art-banner {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .ascii-art-content {
        transform: scale(0.45);
    }
    .ascii-art-banner {
        padding: 15px;
        margin: 20px 0;
    }
    .ascii-art-version {
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    .ascii-art-content {
        transform: scale(0.35);
    }
    .ascii-art-banner {
        padding: 10px;
    }
    .ascii-art-version {
        font-size: 12px;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .ascii-art-content {
        transform: scale(0.28);
    }
}

/* 컨테이너가 scale된 콘텐츠 크기에 맞게 조정 */
.ascii-art-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Scale에 따른 높이 조정 */
@media (max-width: 1400px) {
    .ascii-art-banner { min-height: 180px; }
}

@media (max-width: 1200px) {
    .ascii-art-banner { min-height: 160px; }
}

@media (max-width: 992px) {
    .ascii-art-banner { min-height: 120px; }
}

@media (max-width: 768px) {
    .ascii-art-banner { min-height: 100px; }
}

@media (max-width: 576px) {
    .ascii-art-banner { min-height: 80px; }
}

@media (max-width: 480px) {
    .ascii-art-banner { min-height: 70px; }
}