/* style.css */
/* Complete and stable stylesheet for the Gods Encyclopedia project. */

/* --- Fonts and Body --- */
:root {
    --font-primary: 'Kanit', sans-serif;
    --font-title: 'Cinzel', serif;
    --font-subtitle: 'Pridi', serif;
    --color-bg: #0c0a18; /* Deep space blue/purple */
    --color-text: #e0e7ff; /* Light lavender white */
    --color-gold: #FFD700;
    --color-gold-dark: #b8860b;
    --color-card-bg: rgba(26, 26, 46, 0.85); /* Dark purple-blue card bg */
    --color-border: rgba(255, 215, 0, 0.2);
    --color-border-hover: rgba(255, 215, 0, 0.6);
    --color-text-muted: #aab4d3;
}

body {
    font-family: var(--font-primary);
    margin: 0;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    overflow-x: hidden;
}

.font-cinzel { font-family: var(--font-title); }
.font-pridi { font-family: var(--font-subtitle); }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 2;
}

#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* --- Header --- */
.main-header {
    height: 60vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 2;
    color: white;
    padding: 20px;
}

.header-content {
    animation: fadeInDown 1.5s ease-out;
}

.main-header h1 {
    font-size: clamp(3.5rem, 10vw, 7rem);
    letter-spacing: 3px;
    color: var(--color-gold);
    text-shadow: 0 0 10px var(--color-gold), 0 0 20px var(--color-gold), 0 0 35px #000;
    margin: 0;
}

.header-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--color-text);
    text-shadow: 1px 1px 3px #000;
    margin-top: 10px;
    letter-spacing: 1px;
}

/* --- God Grid (Olympus.php) --- */
.god-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.god-card-link {
    text-decoration: none;
    display: block;
    perspective: 1000px;
}

.god-card {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
}

.god-card:hover {
    transform: translateY(-15px);
    border-color: var(--color-border-hover);
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.15);
}

.god-card-image-wrapper {
    position: relative;
    height: 400px;
}

.god-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.god-card:hover .god-card-image {
    transform: scale(1.05);
}

.god-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(12, 10, 24, 0.9) 10%, transparent);
}

.god-card-name {
    padding: 20px;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    color: var(--color-gold);
    text-shadow: 0 0 5px var(--color-gold-dark);
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    z-index: 3;
}

/* --- God Detail Page (view_god.php) --- */
.god-detail-container {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    padding: 40px;
    border-radius: 12px;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    position: relative;
}

.god-main-title {
    text-align: center;
    margin-bottom: 30px;
}
.god-main-title h2 { font-size: 3rem; color: var(--color-gold); margin: 0;}
.god-main-title h3 { font-size: 1.5rem; color: var(--color-text); margin-top: 5px; font-weight: 400; }

.back-to-pantheon {
    color: var(--color-gold);
    text-decoration: none;
    font-size: 1.5rem;
    transition: text-shadow 0.3s;
}
.back-to-pantheon:hover {
    text-shadow: 0 0 8px var(--color-gold);
}

.tabs {
    display: flex;
    justify-content: center;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 30px;
    gap: 20px;
}

.tab-link {
    background-color: transparent; border: none; padding: 15px 25px; cursor: pointer;
    font-size: 1.25rem; transition: color 0.3s, border-bottom 0.3s;
    border-bottom: 3px solid transparent; color: rgba(224, 231, 255, 0.6);
}
.tab-link:hover { color: var(--color-text); }
.tab-link.active { border-bottom-color: var(--color-gold); font-weight: 700; color: var(--color-gold); }

.content-section h4 {
    font-size: 1.6rem; color: var(--color-gold); font-family: var(--font-subtitle);
    border-bottom: 1px solid var(--color-border); padding-bottom: 10px; margin-bottom: 20px;
}

.image-tabs { display: flex; gap: 10px; margin-bottom: 15px; }
.image-tab-link {
    background: rgba(255,255,255,0.05); border: 1px solid var(--color-border);
    padding: 8px 15px; border-radius: 20px; cursor: pointer; color: var(--color-text);
    transition: all 0.3s;
}
.image-tab-link.active { background: var(--color-gold); color: #000; border-color: var(--color-gold); font-weight: 500;}

.info-dropdown {
    border: 1px solid var(--color-border); border-radius: 8px; margin-bottom: 15px;
    background-color: rgba(0,0,0,0.1); transition: background-color 0.3s;
}
.info-dropdown[open] { background-color: rgba(0,0,0,0.2); }
.info-dropdown summary {
    padding: 15px 20px; font-weight: 600; cursor: pointer; font-size: 1.25rem;
    outline: none; color: var(--color-text); list-style-type: '★ ';
}
.info-dropdown[open] summary { color: var(--color-gold); }
.bbcode-content { padding: 0 20px 20px 20px; border-top: 1px solid var(--color-border); margin-top: 15px; }

/* BBCode Content Styling */
.bbcode-img { max-width: 100%; height: auto; border-radius: 8px; margin: 1em 0; }
.bbcode-content p { margin-bottom: 1em; }
.bbcode-content strong { color: var(--color-gold); }
.bbcode-content a { color: #87CEEB; text-decoration: none; }
.bbcode-content a:hover { text-decoration: underline; }
.bbcode-content ul, .bbcode-content ol { padding-left: 25px; margin-bottom: 1em; }
.bbcode-content blockquote {
    border-left: 5px solid var(--color-gold);
    padding: 15px 20px;
    margin: 1.5em 0;
    background-color: rgba(0,0,0,0.2);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--color-text-muted);
    position: relative;
}
.bbcode-content blockquote::before {
    content: '“';
    font-family: Georgia, serif;
    font-size: 4rem;
    color: rgba(255, 215, 0, 0.2);
    position: absolute;
    left: 10px;
    top: -10px;
    line-height: 1;
}

/* --- Demigod Power Button --- */
@keyframes pulse-glow {
  0% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.2), 0 0 10px rgba(255, 215, 0, 0.2), inset 0 0 5px rgba(255, 215, 0, 0.1); }
  50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 0 30px rgba(255, 215, 0, 0.5), inset 0 0 10px rgba(255, 215, 0, 0.3); }
  100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.2), 0 0 10px rgba(255, 215, 0, 0.2), inset 0 0 5px rgba(255, 215, 0, 0.1); }
}
.demigod-power-button-container { text-align: center; margin: 15px 0 35px 0; }
.demigod-power-button {
    background: linear-gradient(145deg, rgba(26, 26, 46, 0.9), rgba(40, 35, 70, 0.9));
    border: 2px solid transparent; border-radius: 50px; color: var(--color-gold);
    cursor: pointer; display: inline-flex; align-items: center; gap: 15px;
    padding: 12px 30px; transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative; overflow: hidden; text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
    animation: pulse-glow 4s infinite ease-in-out;
}
.demigod-power-button::before {
    content: ''; position: absolute; top: -2px; left: -2px;
    right: -2px; bottom: -2px;
    background: linear-gradient(45deg, var(--color-gold-dark), var(--color-gold), var(--color-gold-dark));
    z-index: -1; border-radius: 50px; transition: opacity 0.4s;
}
.demigod-power-button:hover {
    transform: translateY(-5px) scale(1.05); color: #fff;
    text-shadow: 0 0 12px var(--color-gold); background: linear-gradient(145deg, #b8860b, #ffd700);
}
.demigod-power-button:hover::before { opacity: 0; }
.demigod-power-button .power-icon {
    width: 28px; height: 28px; transition: transform 0.4s ease, filter 0.4s ease;
    filter: drop-shadow(0 0 5px var(--color-gold));
}
.demigod-power-button:hover .power-icon { transform: scale(1.2); filter: drop-shadow(0 0 8px #fff); color: #0c0a18; }
.demigod-power-button span { font-size: 1.4rem; font-weight: 600; }

/* --- UI Button Styles (for Nametag) --- */
.ui-button-primary {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 10px 20px; border: none;
    border-radius: 8px; cursor: pointer; font-size: 1.1rem;
    font-weight: 500; color: #333;
    background: linear-gradient(135deg, #ffd93b, #ffb347);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2), inset 0 -2px 0 rgba(0,0,0,0.15);
    transition: all 0.2s ease-in-out;
}
.ui-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3), inset 0 -2px 0 rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #ffe066, #ffbe76);
}
.ui-button-primary svg { width: 20px; height: 20px; }

/* --- 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: var(--color-bg); margin: 5% auto; padding: 30px;
    border: 1px solid var(--color-gold); width: 90%; max-width: 850px;
    border-radius: 12px; position: relative; box-shadow: 0 0 30px rgba(0,0,0,0.5);
    animation: zoomIn 0.5s;
}
.close-button { color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer; }
.modal-section h4 { color: var(--color-gold); font-family: var(--font-subtitle); border-bottom: 1px solid var(--color-border); padding-bottom: 10px; margin-bottom: 10px; }

/* --- Demigod Power Modal Content (Dropdown Style) --- */
.demigod-power-list-container {
    max-height: 60vh; overflow-y: auto; padding: 5px;
    background: rgba(0,0,0,0.2); border-radius: 8px;
}
details.power-item {
    border: 1px solid rgba(192, 192, 255, 0.3); border-radius: 16px; margin-bottom: 15px;
    animation: fadeIn 0.5s; transition: box-shadow 0.3s ease;
    overflow: hidden; background: radial-gradient(circle, rgba(48, 43, 82, 0.5) 0%, rgba(30, 26, 56, 0.5) 100%);
}
details.power-item:hover { box-shadow: 0 8px 32px 0 rgba(106, 90, 205, 0.3); }
details.power-item[open] { border-color: rgba(255, 215, 0, 0.5); }
summary.power-header {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: nowrap; gap: 15px; padding: 20px 25px; cursor: pointer;
    list-style: none; transition: background-color 0.3s ease;
}
summary.power-header::-webkit-details-marker { display: none; }
summary.power-header::after {
    content: '▼'; font-size: 1.2rem; color: var(--color-gold);
    transition: transform 0.3s ease; margin-left: 20px; flex-shrink: 0;
}
details[open] > summary.power-header::after { transform: rotate(180deg); }
details[open] > summary.power-header { background-color: rgba(255, 215, 0, 0.1); }
.power-header h4 {
    color: var(--color-gold); font-size: 1.6rem; margin: 0; flex-grow: 1;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.power-details-grid { display: flex; gap: 10px; flex-shrink: 0; align-items: center; }
.power-content-wrapper {
    padding: 0 25px 25px 25px; background-color: rgba(12, 10, 24, 0.5);
    border-top: 1px solid var(--color-gold-dark);
}
.detail-tag {
    padding: 5px 15px; border-radius: 20px; font-size: 0.9rem; font-weight: 600;
    color: #fff; border: none; text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}
.detail-tag.tag-level { background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%); }
.detail-tag.tag-cost { background: linear-gradient(135deg, #c43a30 0%, #b21f1f 100%); }
.power-section-header {
    font-family: var(--font-subtitle); color: var(--color-text); font-weight: 600;
    font-size: 1.2rem; margin: 20px 0 10px 0; opacity: 0.9;
    text-transform: uppercase; letter-spacing: 1px;
}
.power-description {
    line-height: 1.8; margin-bottom: 20px; font-size: 1.05rem;
    padding-left: 10px; border-left: 3px solid var(--color-gold-dark);
}
.power-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px; margin-top: 10px;
}
.stat-item {
    background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(135, 206, 235, 0.4);
    border-radius: 12px; text-align: center; padding: 15px 10px;
    backdrop-filter: blur(2px); transition: background-color 0.3s, transform 0.3s;
}
.stat-item:hover { transform: translateY(-3px) scale(1.02); background-color: rgba(0, 0, 0, 0.5); }
.stat-item strong {
    display: block; font-size: 1rem; color: rgba(135, 206, 235, 1);
    margin-bottom: 8px; text-transform: uppercase;
}
.stat-item span {
    font-family: var(--font-title); font-size: 1.8rem; font-weight: bold;
    color: var(--color-text); text-shadow: 0 0 5px rgba(135, 206, 235, 0.5);
}

.power-stats.bonus {
    display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 12px;
}
.power-stats.bonus .stat-item {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none; border-radius: 30px; padding: 8px 18px; color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2); flex-grow: 0;
    min-width: 110px; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.power-stats.bonus .stat-item strong {
    color: rgba(255, 255, 255, 0.85); font-size: 0.9rem; margin-right: 8px;
    display: inline-block; margin-bottom: 0; font-weight: 500;
}
.power-stats.bonus .stat-item span {
    font-family: var(--font-primary); font-size: 1.1rem; font-weight: 700;
    color: #fff; text-shadow: none; display: inline-block;
}

.favor-hearts-container { display: flex; gap: 5px; padding: 10px; background: rgba(0,0,0,0.2); border-radius: 8px; }
.heart-icon {
    width: 28px; height: 28px; stroke: #ff7b7b; stroke-width: 1.5;
    fill: transparent; transition: fill 0.3s ease, transform 0.3s ease;
}
.heart-icon.filled {
    fill: #ff4d4d; stroke: #e02a2a;
    animation: heart-beat 0.6s ease-in-out;
}
@keyframes heart-beat {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* --- Footer --- */
footer { text-align: center; padding: 40px 20px; margin-top: 40px; color: rgba(224, 231, 255, 0.5); position: relative; z-index: 2; }

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes zoomIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* === Responsive Adjustments for Mobile === */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    
    .god-detail-container {
        padding: 20px;
    }

    .god-main-title h2 {
        font-size: 2.2rem; /* Reduced from 3rem */
    }

    .god-main-title h3 {
        font-size: 1.2rem; /* Reduced from 1.5rem */
    }

    .god-title-container {
        flex-direction: column;
        gap: 15px;
    }
    .title-button-left, .title-button-right {
        width: auto;
        text-align: center;
    }

    .tabs {
        gap: 5px;
    }

    .tab-link {
        padding: 12px 15px;
        font-size: 1rem;
    }

    .demigod-power-button {
        padding: 10px 20px;
    }
    .demigod-power-button span {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .main-header h1 {
        font-size: clamp(2.5rem, 15vw, 4rem);
    }
    .main-header-subtitle {
        font-size: clamp(1rem, 4vw, 1.2rem);
    }
    .god-main-title h2 {
        font-size: 1.8rem;
    }
    .god-main-title h3 {
        font-size: 1rem;
    }
    .modal-content {
        padding: 20px;
    }
}
