/* ---
==========================================================================
   HERMES GOSSIP - FULL STYLESHEET (v.Final)
   Contains styles for ALL pages:
   1. Public Page (index.php) with new header design
   2. Admin Page (admin.php)
   3. Login Page (login.php)
==========================================================================
--- */

/*
==========================================================================
   1. GLOBAL & PUBLIC PAGE STYLES (index.php)
==========================================================================
*/

/* --- GLOBAL VARIABLES --- */
:root {
    --font-primary: 'Sarabun', sans-serif;
    --font-display: 'Cinzel', serif;
    --color-gold: #FFD700;
    --color-dark-gold: #c5a000;
    --color-purple-deep: #0f0c29;
    --color-purple-mid: #302b63;
    --color-purple-light: #24243e;
    --color-text-light: #EAEAEA;
    --color-text-dark: #333;
    --color-white: #ffffff;
    --bg-gradient-admin: linear-gradient(135deg, #1e296d 0%, #3949ab 100%);
}

/* --- DEFAULT BODY STYLE (For Admin & Login) --- */
body {
    font-family: var(--font-primary);
    line-height: 1.7;
    margin: 0;
    background-color: #e8eaf6;
    background-image: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%23c5cae9" fill-opacity="0.4"%3E%3Cpath d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
    color: var(--color-text-dark);
}

/* --- PUBLIC PAGE (index.php) SPECIFIC STYLES --- */
body.public-page {
    background: linear-gradient(to bottom, var(--color-purple-deep), var(--color-purple-mid), var(--color-purple-light));
    color: var(--color-text-light);
    overflow-x: hidden;
}

.stars-bg { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; z-index: -1; overflow: hidden; }
@keyframes animStar { from { transform: translateY(0px); } to { transform: translateY(-2000px); } }
#stars1, #stars2, #stars3 { position: absolute; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; display: block; }
#stars1:after, #stars2:after, #stars3:after { content: ""; position: absolute; width: 100%; height: 2000px; background-repeat: repeat; background-position: center; animation: animStar 50s linear infinite; }
#stars1:after { background-image: radial-gradient(1px 1px at 20px 30px, white, transparent), radial-gradient(1px 1px at 40px 80px, white, transparent), radial-gradient(1px 1px at 90px 40px, white, transparent), radial-gradient(1px 1px at 150px 120px, white, transparent), radial-gradient(1px 1px at 200px 180px, white, transparent); background-size: 200px 200px; }
#stars2:after { background-image: radial-gradient(2px 2px at 50px 150px, white, transparent), radial-gradient(2px 2px at 100px 50px, white, transparent), radial-gradient(2px 2px at 180px 100px, white, transparent); background-size: 200px 200px; animation-duration: 100s; }
#stars3:after { background-image: radial-gradient(3px 3px at 80px 80px, white, transparent), radial-gradient(3px 3px at 160px 160px, white, transparent); background-size: 200px 200px; animation-duration: 150s; }

.public-page .site-wrapper { display: flex; flex-direction: column; min-height: 100vh; position: relative; z-index: 1; }

/* --- NEW OLYMPIAN HEADER --- */
.public-page .main-header {
    color: var(--color-white);
    text-align: center;
    padding: 3rem 1rem 4rem 1rem;
    position: relative;
    background: radial-gradient(ellipse at center, rgba(36, 36, 62, 0.8) 0%, var(--color-purple-deep) 70%),
                linear-gradient(to bottom, var(--color-purple-deep), var(--color-purple-mid));
    border-bottom: 3px solid var(--color-gold);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), inset 0 -10px 20px -10px rgba(0,0,0,0.4);
    overflow: hidden;
}
.public-page .main-header::before, .public-page .main-header::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 150px;
    height: 150px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="rgba(255,215,0,0.3)" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><path d="M22 12c-4 0-4-4-8-4s-4 4-8 4S0 8 0 8"/><path d="M22 16c-4 0-4-4-8-4s-4 4-8 4S0 12 0 12"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.5;
    z-index: 0;
}
.public-page .main-header::before { left: 5%; }
.public-page .main-header::after { right: 5%; transform: translateY(-50%) scaleX(-1); }

.public-page .header-home-button { position: absolute; top: 20px; right: 20px; display: flex; align-items: center; gap: 8px; padding: 12px 18px; background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); color: var(--color-white); border: 1px solid rgba(255, 215, 0, 0.5); border-radius: 50px; text-decoration: none; font-weight: bold; font-size: 1rem; transition: all 0.3s ease; z-index: 10; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
.public-page .header-home-button:hover { background: var(--color-gold); color: var(--color-purple-deep); box-shadow: 0 4px 15px rgba(255, 215, 0, 0.5); transform: translateY(-3px) scale(1.05); }

.public-page .logo-container { position: relative; z-index: 1; }
.public-page .site-title { font-family: var(--font-display); font-size: 4rem; font-weight: 900; margin: 0.5rem 0; letter-spacing: 5px; color: var(--color-white); text-shadow: 0 0 8px var(--color-gold), 0 0 15px var(--color-gold), 0 0 25px var(--color-gold), 0 0 40px rgba(255, 215, 0, 0.7); }
.public-page .site-subtitle { margin: 0; font-size: 1.2rem; opacity: 0.9; font-style: italic; letter-spacing: 1px; }

/* --- TWO COLUMN LAYOUT FOR NEWS --- */
.public-page .news-container {
    max-width: 1400px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
}
@media (max-width: 1024px) {
    .public-page .news-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.public-page .gossip-item { background: rgba(36, 36, 62, 0.4); backdrop-filter: blur(12px) saturate(150%); -webkit-backdrop-filter: blur(12px) saturate(150%); border-radius: 20px; border: 1px solid rgba(255, 255, 255, 0.15); margin-bottom: 0; padding: 0; box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37); transition: all 0.3s ease; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.public-page .gossip-item:before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle at center, rgba(255, 215, 0, 0.2), transparent 40%); transform: rotate(0deg); transition: transform 1s ease; z-index: 0; pointer-events: none; }
.public-page .gossip-item:hover:before { transform: rotate(180deg); }
.public-page .gossip-item > * { position: relative; z-index: 1; }
.public-page .gossip-item.no-news { text-align: center; padding: 3rem; color: var(--color-text-light); grid-column: 1 / -1; }

.gossip-header-image { width: 100%; height: 250px; object-fit: cover; border-radius: 20px 20px 0 0; border-bottom: 1px solid rgba(255, 215, 0, 0.5); display: block; }
.gossip-item-content { padding: 2rem; }

.public-page .gossip-header { border-bottom: 1px solid rgba(255, 255, 255, 0.2); margin-bottom: 1.5rem; padding-bottom: 1.5rem; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.public-page .gossip-title { font-family: var(--font-display); font-size: 2.2rem; color: var(--color-white); margin: 0; text-shadow: 0 0 5px rgba(255, 215, 0, 0.7); }
.public-page .gossip-dates { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; color: rgba(255, 255, 255, 0.7); }
.public-page .gossip-date, .public-page .gossip-expiry-date { font-size: 0.9rem; font-style: italic; display: flex; align-items: center; gap: 8px; }
.public-page .gossip-expiry-date { color: #ff8a80; font-weight: bold; }
.public-page .gossip-content { font-size: 1.1rem; color: var(--color-text-light); word-wrap: break-word; }
.public-page .gossip-content a { color: var(--color-gold); text-decoration: none; font-weight: bold; border-bottom: 1px dashed var(--color-gold); }
.public-page .gossip-content img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.2); margin: 10px 0; }
.public-page .gossip-footer { margin-top: 1.5rem; padding-top: 1rem; text-align: right; display: flex; justify-content: flex-end; align-items: center; }
.public-page .reward-tag { display: inline-block; background: linear-gradient(45deg, var(--color-dark-gold), var(--color-gold)); color: var(--color-purple-deep); padding: 0.6rem 1.2rem; border-radius: 20px; font-weight: bold; font-size: 0.9rem; box-shadow: 0 2px 10px rgba(0,0,0,0.3); text-shadow: none; }
.public-page .main-footer { text-align: center; padding: 1.5rem; background: transparent; color: rgba(255, 255, 255, 0.5); font-size: 0.9rem; }
.public-page .main-footer a { color: var(--color-gold); text-decoration: none; }

/*
==========================================================================
   2. ADMIN & LOGIN PAGE STYLES
==========================================================================
*/

.container { max-width: 900px; margin: 2rem auto; padding: 0 1rem; }
.button-primary, .button-secondary, .button-danger, .button-sm { padding: 10px 20px; border: none; border-radius: 5px; font-family: var(--font-primary); font-weight: bold; cursor: pointer; text-decoration: none; display: inline-block; transition: all 0.3s ease; text-align: center; }
.button-primary { background: var(--bg-gradient-admin); color: var(--color-white); box-shadow: 0 4px 15px rgba(50, 61, 158, 0.4); }
.button-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(50, 61, 158, 0.5); }
.button-secondary { background-color: #7986cb; color: white; }
.button-secondary:hover { background-color: #5c6bc0; }
.button-danger { background-color: #e53935; color: white; }
.button-danger:hover { background-color: #c62828; }
.button-sm { padding: 5px 10px; font-size: 0.8rem; }
.input-group { margin-bottom: 1.5rem; text-align: left; }
.input-group label { display: block; margin-bottom: 0.5rem; font-weight: bold; color: #444; }
.input-group input[type="text"], .input-group input[type="password"], .input-group input[type="date"] { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; transition: border-color 0.3s, box-shadow 0.3s; }
.input-group input:focus { outline: none; border-color: #1a237e; box-shadow: 0 0 5px rgba(26, 35, 126, 0.3); }

/* --- LOGIN PAGE --- */
.login-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: var(--bg-gradient-admin); }
.login-box { background: var(--color-white); padding: 2rem 3rem; border-radius: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); text-align: center; width: 100%; max-width: 400px; color: var(--color-text-dark); }
.login-box h1 { font-family: var(--font-display); color: #1a237e; margin-bottom: 0; }
.login-box h2 { color: #555; margin-top: 0.5rem; margin-bottom: 2rem; font-weight: normal; }
.error-message { background-color: #ffcdd2; color: #c62828; padding: 10px; border-radius: 5px; }

/* --- ADMIN PAGE --- */
.admin-header { background: #333; color: white; padding: 1rem 2rem; display: flex; align-items: center; gap: 1rem; }
.admin-header h1 { margin: 0; font-size: 1.5rem; flex-grow: 1; }
.admin-container { display: grid; grid-template-columns: 1fr; gap: 2rem; max-width: 1200px; }
@media (min-width: 960px) { .admin-container { grid-template-columns: 1fr 1fr; } }
.card { background: var(--color-white); padding: 2rem; border-radius: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.07); color: var(--color-text-dark); }
.card h2 { margin-top: 0; border-bottom: 2px solid #eee; padding-bottom: 0.5rem; color: #1a237e; }
.success-message { background-color: #dcedc8; color: #33691e; padding: 10px; border-radius: 5px; }
.news-list-table table { width: 100%; border-collapse: collapse; }
.news-list-table th, .news-list-table td { padding: 12px; text-align: left; border-bottom: 1px solid #eee; }
.news-list-table th { background-color: #f8f9fa; font-weight: bold; }
.news-list-table tr:hover { background-color: #f1f3f5; }
.action-buttons { display: flex; gap: 5px; flex-wrap: wrap; }
.status-active { color: #2e7d32; font-weight: bold; }
.status-inactive { color: #9e9e9e; }
