/*
Theme Name: Ernest of Gaia Theme
Theme URI: https://ernestofgaia.xyz
Author: Ernest of Gaia
Author URI: https://ernestofgaia.xyz
Description: A mystical alchemist themed WordPress theme for documenting trading ideas and grid bots.
Version: 1.3.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ernest-of-gaia
*/

/* ===== CSS VARIABLES ===== */
:root {
    --bg-primary: #0a0f0a;
    --bg-secondary: #121a12;
    --bg-card: #0d140d;
    --gold: #c9a227;
    --gold-light: #e6c547;
    --silver: #c0c0c0;
    --silver-light: #d4d4d4;
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0a0;
    --text-muted: #6a6a6a;
    --border-gold: #8b7355;
    --border-silver: #6a6a6a;
    --glow-gold: rgba(201, 162, 39, 0.4);
    --glow-silver: rgba(192, 192, 192, 0.3);
    --success: #2d5a3d;
    --danger: #5a2d2d;
    --font-title: 'Cinzel', 'Playfair Display', Georgia, serif;
    --font-body: 'Cormorant Garamond', Georgia, serif;
    --font-mono: 'Fira Code', 'Source Code Pro', 'Courier New', monospace;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-primary);
    background-image: 
        radial-gradient(ellipse at top, rgba(18, 26, 18, 0.8) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(10, 15, 10, 1) 0%, transparent 50%);
    min-height: 100vh;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    color: var(--gold);
    margin-top: 0;
    line-height: 1.3;
    letter-spacing: 0.05em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.3rem; }

p {
    margin-bottom: 1.2rem;
}

a {
    color: var(--gold);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--gold-light);
    text-shadow: 0 0 10px var(--glow-gold);
}

/* ===== LAYOUT ===== */
.site-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== HEADER ===== */
.site-header {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-gold);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

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

.site-title {
    font-family: var(--font-title);
    font-size: 1.8rem;
    color: var(--gold);
    margin: 0;
    text-shadow: 0 0 15px var(--glow-gold);
}

.site-title a {
    color: inherit;
}

.site-title a:hover {
    text-shadow: 0 0 25px var(--glow-gold);
}

/* ===== NAVIGATION ===== */
.main-navigation {
    display: flex;
    align-items: center;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 10px;
}

.main-navigation li {
    margin: 0;
}

.main-navigation a {
    display: block;
    padding: 10px 18px;
    color: var(--text-primary);
    font-family: var(--font-title);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a {
    color: var(--gold);
    border-color: var(--border-gold);
    box-shadow: 0 0 15px var(--glow-gold), inset 0 0 15px rgba(201, 162, 39, 0.1);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-gold);
    color: var(--gold);
    padding: 10px 15px;
    cursor: pointer;
    font-family: var(--font-title);
}

/* ===== MAIN CONTENT ===== */
.site-main {
    min-height: calc(100vh - 200px);
    padding: 40px 0;
}

/* ===== MYSTICAL CARDS ===== */
.mystical-card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.mystical-card:hover {
    border-color: var(--gold);
    box-shadow: 0 0 25px var(--glow-gold), 0 4px 30px rgba(0, 0, 0, 0.5);
}

.mystical-card.silver-border {
    border-color: var(--border-silver);
}

.mystical-card.silver-border:hover {
    border-color: var(--silver);
    box-shadow: 0 0 25px var(--glow-silver), 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-spawning {
    background: rgba(201, 162, 39, 0.2);
    color: var(--gold);
    border: 1px solid var(--gold);
}

.status-active {
    background: rgba(45, 90, 61, 0.3);
    color: #4ade80;
    border: 1px solid #4ade80;
}

.status-invalidated {
    background: rgba(90, 45, 45, 0.3);
    color: #f87171;
    border: 1px solid #f87171;
}

.status-completed {
    background: rgba(192, 192, 192, 0.2);
    color: var(--silver);
    border: 1px solid var(--silver);
}

/* ===== CHART CONTAINERS ===== */
.chart-container {
    margin-bottom: 30px;
}

.chart-single {
    width: 100%;
    border: 2px solid var(--border-gold);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.chart-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.chart-dual .chart-frame {
    border: 2px solid var(--border-gold);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Chart Image Styles */
.chart-image-frame {
    background: var(--bg-secondary);
}

.chart-image-frame .chart-image-link {
    display: block;
    text-decoration: none;
}

.chart-image-frame .chart-image {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.chart-image-frame .chart-image-link:hover .chart-image {
    transform: scale(1.02);
    opacity: 0.95;
}

.chart-no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
}

.chart-no-image span {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.chart-no-image p {
    margin: 0;
    font-style: italic;
}

/* ===== DATA DISPLAY ===== */
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.data-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid var(--gold);
}

.data-label {
    font-family: var(--font-title);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 5px;
}

.data-value {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--gold-light);
}

/* ===== TABS ===== */
.tabs-container {
    margin: 30px 0;
}

.tabs-nav {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid var(--border-gold);
    margin-bottom: 25px;
}

.tab-button {
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    color: var(--text-secondary);
    padding: 12px 25px;
    font-family: var(--font-title);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
}

.tab-button:hover {
    color: var(--gold);
    background: rgba(201, 162, 39, 0.1);
}

.tab-button.active {
    color: var(--gold);
    background: var(--bg-card);
    border-color: var(--border-gold);
    border-bottom-color: var(--bg-card);
    margin-bottom: -2px;
}

.tab-content {
    display: none;
}

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

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

/* ===== POSTS LIST ===== */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-item {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    padding: 25px;
    transition: all 0.3s ease;
}

.post-item:hover {
    border-color: var(--gold);
    box-shadow: 0 0 20px var(--glow-gold);
    transform: translateY(-2px);
}

.post-item-title {
    font-family: var(--font-title);
    font-size: 1.4rem;
    color: var(--gold);
    margin: 0 0 10px 0;
}

.post-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.post-item-excerpt {
    color: var(--text-secondary);
    margin: 0;
}

/* ===== STATS DISPLAY ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.stat-card {
    background: var(--bg-card);
    border: 2px solid var(--border-gold);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--gold);
    box-shadow: 0 0 30px var(--glow-gold);
}

.stat-number {
    font-family: var(--font-mono);
    font-size: 3rem;
    color: var(--gold);
    display: block;
    text-shadow: 0 0 20px var(--glow-gold);
}

.stat-label {
    font-family: var(--font-title);
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 10px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    font-family: var(--font-title);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid;
}

.btn-gold {
    background: transparent;
    color: var(--gold);
    border-color: var(--gold);
}

.btn-gold:hover {
    background: var(--gold);
    color: var(--bg-primary);
    box-shadow: 0 0 25px var(--glow-gold);
}

.btn-silver {
    background: transparent;
    color: var(--silver);
    border-color: var(--silver);
}

.btn-silver:hover {
    background: var(--silver);
    color: var(--bg-primary);
    box-shadow: 0 0 25px var(--glow-silver);
}

/* ===== EVOLVE BUTTON (Admin) ===== */
.evolve-button {
    background: linear-gradient(135deg, var(--gold) 0%, #8b6914 100%);
    color: var(--bg-primary);
    border: none;
    padding: 15px 30px;
    font-family: var(--font-title);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    cursor: pointer;
    border-radius: 8px;
    margin: 20px 0;
    transition: all 0.3s ease;
}

.evolve-button:hover {
    box-shadow: 0 0 30px var(--glow-gold), 0 0 60px rgba(201, 162, 39, 0.3);
    transform: translateY(-2px);
}

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 50px var(--glow-gold);
    animation: modalSlideIn 0.3s ease;
}

.modal-content.modal-large {
    max-width: 700px;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: scale(0.9) translateY(-20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-title {
    font-family: var(--font-title);
    color: var(--gold);
    margin: 0 0 25px 0;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--gold);
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-family: var(--font-title);
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-primary);
    border: 1px solid var(--border-gold);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 15px var(--glow-gold);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
    font-style: italic;
}

/* Modal Image Upload Styles */
.ernest-modal-image-upload {
    margin-bottom: 15px;
}

.ernest-modal-image-preview {
    margin-bottom: 10px;
    background: var(--bg-primary);
    border: 2px dashed var(--border-gold);
    border-radius: 8px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ernest-modal-image-preview img {
    max-width: 100%;
    max-height: 200px;
    height: auto;
    border-radius: 4px;
}

.ernest-modal-image-preview .ernest-no-image {
    color: var(--text-muted);
    font-style: italic;
    padding: 20px;
}

.ernest-image-buttons {
    display: flex;
    gap: 10px;
}

/* ===== TAGS ===== */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.tag {
    background: rgba(201, 162, 39, 0.15);
    color: var(--gold);
    padding: 5px 12px;
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    border: 1px solid var(--border-gold);
    transition: all 0.3s ease;
}

.tag:hover {
    background: rgba(201, 162, 39, 0.3);
    box-shadow: 0 0 10px var(--glow-gold);
}

/* ===== JOURNAL CONTENT ===== */
.journal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-silver);
    border-radius: 8px;
    padding: 30px;
    margin-top: 30px;
}

.journal-content h3 {
    color: var(--silver);
    border-bottom: 1px solid var(--border-silver);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.journal-content p {
    color: var(--text-secondary);
}

/* ===== YOUTUBE PLAYLIST CONTAINER ===== */
.youtube-playlist-container {
    margin: 30px 0;
    border: 2px solid var(--border-gold);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
    min-height: 600px;
    position: relative;
}

.youtube-playlist-container iframe {
    display: block;
    width: 100%;
    min-height: 600px;
    border: none;
    border-radius: 10px;
}

.youtube-playlist-container:hover {
    border-color: var(--gold);
    box-shadow: 0 0 30px var(--glow-gold);
}

.youtube-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
}

.youtube-placeholder p {
    margin: 10px 0;
}

.youtube-placeholder p:first-child {
    font-size: 1.5rem;
    color: var(--gold);
}

/* Legacy X widget styles (kept for backward compatibility) */
.x-widget-container {
    margin: 30px 0;
    border: 2px solid var(--border-gold);
    border-radius: 12px;
    overflow: hidden;
    background: #15202b;
    min-height: 400px;
}

.x-widget-container .twitter-timeline {
    display: block;
}

.x-widget-container iframe {
    border-radius: 10px !important;
}

/* ===== FOOTER ===== */
.site-footer {
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-gold);
    padding: 40px 0;
    margin-top: 60px;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-disclaimer {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-muted);
    font-style: italic;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid var(--border-silver);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
}

.footer-copyright {
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== HOMEPAGE SPECIFIC ===== */
.hero-section {
    text-align: center;
    padding: 60px 0;
}

.hero-title {
    font-size: 3rem;
    color: var(--gold);
    text-shadow: 0 0 30px var(--glow-gold);
    margin-bottom: 20px;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: 1.3rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .chart-dual {
        grid-template-columns: 1fr;
    }
    
    .data-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .header-inner {
        flex-direction: column;
        gap: 15px;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .main-navigation {
        display: none;
        width: 100%;
    }
    
    .main-navigation.active {
        display: block;
    }
    
    .main-navigation ul {
        flex-direction: column;
        width: 100%;
    }
    
    .main-navigation a {
        text-align: center;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .data-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs-nav {
        flex-direction: column;
    }
    
    .tab-button {
        border-radius: 8px;
        border: 1px solid var(--border-gold);
        margin-bottom: 5px;
    }
    
    .tab-button.active {
        margin-bottom: 5px;
    }
    
    .modal-content {
        padding: 25px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .youtube-playlist-container {
        min-height: 400px;
    }
    
    .youtube-playlist-container iframe {
        min-height: 400px;
    }
    
    .x-widget-container {
        min-height: 350px;
    }
    
    .chart-no-image {
        min-height: 200px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.4rem;
    }
    
    .mystical-card {
        padding: 20px;
    }
    
    .post-item-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .ernest-image-buttons {
        flex-direction: column;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-silver { color: var(--silver); }
.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.mt-40 { margin-top: 40px; }
.mb-40 { margin-bottom: 40px; }

/* ===== LOADING SPINNER ===== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-gold);
    border-radius: 50%;
    border-top-color: var(--gold);
    animation: spin 1s linear infinite;
}

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

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-gold);
    border-radius: 5px;
}

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