/* Purple Dragon MUD - Modern Fantasy Theme */
/* Shared styles for all pages */

/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Open+Sans:wght@400;500;600&display=swap');

/* CSS Variables */
:root {
    --bg-dark: #0d0a12;
    --bg-primary: #1a1225;
    --bg-secondary: #251a35;
    --bg-card: #2a1f3d;
    --bg-hover: #352a4a;
    --accent-purple: #9966cc;
    --accent-purple-light: #b388e8;
    --accent-gold: #d4a84b;
    --accent-cyan: #5ec4c4;
    --text-primary: #e8e4f0;
    --text-secondary: #a8a0b8;
    --text-muted: #6d6580;
    --border-color: #3d2f55;
    --border-glow: rgba(153, 102, 204, 0.3);
    --shadow-purple: rgba(153, 102, 204, 0.2);
    --gradient-purple: linear-gradient(135deg, #9966cc 0%, #6633aa 100%);
    --gradient-dark: linear-gradient(180deg, #1a1225 0%, #0d0a12 100%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--gradient-dark);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    color: var(--text-primary);
}

a {
    color: var(--accent-purple-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-gold);
}

/* Header */
.header {
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-dark) 100%);
    padding: 40px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center top, var(--shadow-purple) 0%, transparent 70%);
    pointer-events: none;
}

.banner-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(32px, 6vw, 56px);
    font-weight: 700;
    color: var(--accent-purple);
    text-shadow: 0 0 40px var(--shadow-purple), 0 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 4px;
    position: relative;
    margin-bottom: 8px;
}

.banner-subtitle {
    font-family: 'Open Sans', sans-serif;
    font-size: clamp(14px, 2vw, 18px);
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
}

/* Navigation */
.nav-menu {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 20px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px 28px;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(153,102,204,0.2), transparent);
    transition: left 0.5s ease;
}

.nav-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-purple);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow-purple);
}

.nav-btn:hover::before {
    left: 100%;
}

.nav-btn.active {
    background: var(--gradient-purple);
    border-color: var(--accent-purple);
    color: white;
    box-shadow: 0 4px 20px var(--shadow-purple);
}

/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: calc(100vh - 300px);
}

/* Content Boxes / Cards */
.content-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.content-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4), 0 0 20px var(--border-glow);
}

/* Page Titles */
.page-title {
    font-family: 'Cinzel', serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--accent-purple);
    text-align: center;
    padding: 20px;
    margin-bottom: 30px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-shadow: 0 0 20px var(--shadow-purple);
}

/* Section Headers */
.section-header {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-gold);
    padding: 12px 20px;
    margin: 25px 0 15px 0;
    background: linear-gradient(90deg, var(--bg-secondary) 0%, transparent 100%);
    border-left: 3px solid var(--accent-purple);
    border-radius: 0 6px 6px 0;
}

.section-header:first-child {
    margin-top: 0;
}

/* Info Table */
.info-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
}

.info-table-header {
    background: var(--gradient-purple);
    color: white;
    text-align: center;
    padding: 15px;
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 600;
}

.info-table td {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.info-table tr:nth-child(odd) td {
    background: var(--bg-secondary);
}

.info-table tr:nth-child(even) td {
    background: var(--bg-card);
}

.info-table tr:last-child td {
    border-bottom: none;
}

/* Stats Table */
.stats-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
}

.stats-table th {
    background: var(--gradient-purple);
    color: white;
    padding: 15px;
    text-align: center;
    font-family: 'Cinzel', serif;
    font-weight: 600;
}

.stats-table td {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.stats-table td.label {
    color: var(--accent-cyan);
    font-weight: 500;
}

.stats-table td.total,
.stats-table td.value {
    color: var(--text-primary);
    text-align: right;
    font-family: 'Courier New', monospace;
}

.stats-table td.today {
    color: var(--accent-gold);
    text-align: right;
    font-family: 'Courier New', monospace;
}

.stats-table td.gold {
    color: var(--accent-gold);
    text-align: right;
    font-family: 'Courier New', monospace;
}

.stats-table tr:hover td {
    background: var(--bg-hover);
}

.stats-table tr.spacer td {
    background: transparent;
    border: none;
    height: 15px;
    padding: 0;
}

.stats-section-title {
    font-family: 'Cinzel', serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-gold);
    padding: 10px 15px;
    margin: 25px 0 10px 0;
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent-purple);
    border-radius: 0 6px 6px 0;
}

/* Who's On Table */
.whoson-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
}

.whoson-table th {
    background: var(--gradient-purple);
    color: white;
    padding: 12px 15px;
    text-align: center;
    font-family: 'Cinzel', serif;
    font-weight: 600;
}

.whoson-table th:nth-child(2),
.whoson-table th:last-child {
    text-align: left;
}

.whoson-table td {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    text-align: center;
}

.whoson-table td:nth-child(2),
.whoson-table td:last-child {
    text-align: left;
}

.whoson-table td.name { color: #ff99cc; }
.whoson-table td.level { color: var(--accent-cyan); }
.whoson-table td.race { color: #99ff99; }
.whoson-table td.class { color: var(--accent-gold); }
.whoson-table td.clan { color: #ff9966; }

.whoson-table tr:hover td {
    background: var(--bg-hover);
}

/* Link Lists */
.link-list {
    list-style: none;
    padding: 0 10px;
}

.link-list li {
    margin: 12px 0;
    padding: 12px 15px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border-left: 3px solid var(--accent-purple);
    transition: all 0.2s ease;
}

.link-list li:hover {
    background: var(--bg-hover);
    border-left-color: var(--accent-gold);
    transform: translateX(5px);
}

.link-list li a {
    font-weight: 500;
}

/* Connection Info */
.connection-info p {
    margin-bottom: 15px;
}

.host-info {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    background: var(--bg-dark);
    color: var(--accent-cyan);
    padding: 15px 25px;
    border-radius: 6px;
    display: inline-block;
    margin: 10px 0;
    border: 1px solid var(--border-color);
}

/* Welcome Section */
.welcome-text p {
    margin-bottom: 18px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.welcome-text p:first-child {
    font-size: 18px;
    color: var(--text-primary);
}

/* Player Count */
.player-count {
    text-align: center;
    font-size: 18px;
    color: var(--accent-cyan);
    margin-bottom: 20px;
}

.no-players {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
    font-style: italic;
}

/* Discord Section */
.discord-section {
    text-align: center;
    padding: 10px 0;
}

.discord-section-title {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-gold);
    margin-bottom: 20px;
}

.discord-widget {
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Auto-refresh note */
.auto-refresh-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 15px;
}

.credit {
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 15px;
}

/* Legend */
.legend {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.general { background: var(--accent-purple); }
.legend-color.quest { background: #d4a84b; }
.legend-color.clan { background: #5ec4c4; }
.legend-color.party { background: #e066a0; }

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    background: var(--bg-dark);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 14px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.btn-primary {
    background: var(--gradient-purple);
    color: white;
    border-color: var(--accent-purple);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--shadow-purple);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-purple);
}

/* Admin Status */
.admin-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.admin-status .status {
    color: var(--text-muted);
}

.admin-status .status.logged-in {
    color: var(--accent-cyan);
}

.admin-status button {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.admin-status button:hover {
    background: var(--bg-hover);
    border-color: var(--accent-purple);
}

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

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

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    color: var(--accent-gold);
    font-family: 'Cinzel', serif;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

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

.modal-body label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

.modal-body input,
.modal-body select,
.modal-body textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
    outline: none;
    border-color: var(--accent-purple);
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-footer button {
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.btn-save {
    background: linear-gradient(135deg, #4a9a4a 0%, #2d6a2d 100%);
    color: white;
    border-color: #4a9a4a;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 154, 74, 0.3);
}

.btn-delete {
    background: linear-gradient(135deg, #9a4a4a 0%, #6a2d2d 100%);
    color: white;
    border-color: #9a4a4a;
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(154, 74, 74, 0.3);
}

.btn-cancel {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-cancel:hover {
    background: var(--bg-hover);
}

.password-error {
    color: #ff6666;
    font-size: 12px;
    margin-top: -10px;
    margin-bottom: 15px;
    display: none;
}

/* Calendar Specific */
.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.calendar-nav button {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.calendar-nav button:hover {
    background: var(--bg-hover);
    border-color: var(--accent-purple);
}

.calendar-nav .month-year {
    font-family: 'Cinzel', serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--accent-purple);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    background: var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    padding: 4px;
}

.calendar-header {
    background: var(--bg-secondary);
    color: var(--accent-gold);
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
}

.calendar-day {
    background: var(--bg-card);
    min-height: 90px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.calendar-day:hover {
    background: var(--bg-hover);
}

.calendar-day.other-month {
    background: var(--bg-dark);
    opacity: 0.5;
}

.calendar-day.today {
    border: 2px solid var(--accent-gold);
}

.calendar-day .day-number {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.calendar-day.other-month .day-number {
    color: var(--text-muted);
}

.calendar-day .event {
    background: var(--accent-purple);
    color: white;
    padding: 3px 6px;
    margin: 3px 0;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.calendar-day .event:hover {
    transform: scale(1.02);
}

.calendar-day .event.quest { background: #d4a84b; }
.calendar-day .event.clan { background: #5ec4c4; }
.calendar-day .event.party { background: #e066a0; }

/* Event List */
.event-list {
    margin-top: 30px;
}

.event-list h3 {
    color: var(--accent-gold);
    font-family: 'Cinzel', serif;
    margin-bottom: 15px;
}

.event-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--bg-secondary);
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 4px solid var(--accent-purple);
    cursor: pointer;
    transition: all 0.2s ease;
}

.event-list-item:hover {
    background: var(--bg-hover);
    transform: translateX(5px);
}

.event-list-item.quest { border-left-color: #d4a84b; }
.event-list-item.clan { border-left-color: #5ec4c4; }
.event-list-item.party { border-left-color: #e066a0; }

.event-list-item .event-date {
    color: var(--text-muted);
    font-size: 12px;
}

/* Banner Section (for embed codes) */
.banner-section {
    margin: 20px 0;
    padding: 15px;
}

.banner-section code {
    display: block;
    background: var(--bg-dark);
    color: var(--accent-cyan);
    padding: 15px;
    margin: 15px 0;
    font-size: 12px;
    border-radius: 6px;
    word-break: break-all;
    border: 1px solid var(--border-color);
}

/* Remove old section dividers with missing images */
.section-divider {
    display: none;
}

/* Utility classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-0 { margin-bottom: 0; }
.mt-20 { margin-top: 20px; }

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        gap: 6px;
        padding: 15px 10px;
    }

    .nav-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .main-container {
        padding: 20px 15px;
    }

    .content-box {
        padding: 20px;
    }

    .info-table td {
        display: block;
        width: 100%;
    }

    .calendar-day {
        min-height: 60px;
        padding: 5px;
    }

    .calendar-day .event {
        font-size: 10px;
        padding: 2px 4px;
    }
}

@media (max-width: 480px) {
    .banner-title {
        letter-spacing: 2px;
    }

    .nav-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .page-title {
        font-size: 22px;
        padding: 15px;
    }
}
