@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Inter:wght@400;500;600&display=swap');

:root {
    --bg-dark: #0b0c10;
    --bg-panel: #14161c;
    --bg-panel-hover: #1c1f26;
    --text-main: #d1d5db;
    --text-muted: #9ca3af;
    --accent-gold: #cfa631;
    --accent-gold-hover: #e8c655;
    --border-color: #262933;
    
    --font-headers: 'Cinzel', serif;
    --font-text: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-text);
    line-height: 1.6;
    background-image: radial-gradient(circle at 50% 0%, #1a1d24 0%, var(--bg-dark) 50%);
    background-repeat: no-repeat;
    min-height: 100vh;
}

a {
    color: var(--accent-gold);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headers);
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

/* Layout Wrapper */
.layout-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.site-header {
    padding: 40px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.site-title {
    font-size: 3rem;
    color: var(--accent-gold);
    text-shadow: 0 2px 10px rgba(207, 166, 49, 0.2);
    margin: 0;
}

/* =========================================
   CHARACTER PROFILE & CARDS
   ========================================= */
.char-profile-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.char-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    overflow: hidden;
}

.char-header {
    background: rgba(0,0,0,0.4);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.char-header h2 {
    margin: 0;
    color: var(--accent-gold);
    font-size: 1.2rem;
    text-transform: uppercase;
}

.char-body {
    padding: 0;
}

.layout-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.char-details {
    flex: 1;
}

.char-row {
    display: flex;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}

.char-row:last-child {
    border-bottom: none;
}

.char-row:hover {
    background-color: var(--bg-panel-hover);
}

.char-label {
    width: 30%;
    font-family: var(--font-headers);
    color: var(--text-muted);
    font-weight: 600;
}

.char-value {
    width: 70%;
    color: var(--text-main);
}

.char-outfit-box {
    width: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-left: 1px solid var(--border-color);
    padding-left: 20px;
}

.outfit-image {
    max-width: 100px;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.8));
}

.mt-20 { margin-top: 20px; }

/* Character List Box */
.char-list-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    align-items: center;
}

.char-list-row:hover {
    background-color: var(--bg-panel-hover);
}

.char-list-name { font-weight: bold; }
.btn-small { padding: 5px 10px; font-size: 0.8rem; }

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */

/* =========================================
   STICKY NAVIGATION BAR
   ========================================= */
.main-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: rgba(20, 22, 28, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    padding: 0 20px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand {
    font-family: var(--font-headers);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-gold);
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 5px;
    height: 100%;
}

.nav-menu > li {
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-menu a {
    color: var(--text-main);
    font-family: var(--font-headers);
    font-size: 1.1rem;
    padding: 10px 20px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.nav-menu > li > a:hover {
    background-color: var(--bg-panel-hover);
    color: var(--accent-gold);
    text-decoration: none;
}

/* Dropdowns */
.dropdown {
    position: relative;
}

.dropdown-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-panel);
    min-width: 200px;
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.8);
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1001;
    overflow: hidden;
}

.dropdown-content a {
    color: var(--text-main);
    padding: 12px 20px;
    display: block;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    border-radius: 0;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: rgba(207, 166, 49, 0.1);
    color: var(--accent-gold);
    text-decoration: none;
}

/* Dropdown Animation on Hover */
.dropdown:hover .dropdown-content {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* Server Status Indicator */
.nav-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    background: rgba(0,0,0,0.3);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.online {
    background-color: #10b981;
    box-shadow: 0 0 10px #10b981;
}

.status-indicator.offline {
    background-color: #ef4444;
    box-shadow: 0 0 10px #ef4444;
}

/* =========================================
   MAIN CONTENT AREA (FULL WIDTH)
   ========================================= */
.main-content {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    width: 100%;
    margin-top: 20px;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* MyAAC specific overrides for tables and forms */
table, .TableContainer, .TableContent, .Table1, .Table2, .Table3, .DarkTable {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: transparent !important;
}

table td, table th, .TableContent td, .Table1 td, .Table2 td, .Table3 td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid var(--border-color) !important;
    background-color: var(--bg-panel) !important;
    color: var(--text-main) !important;
}

table th, .DarkTable td {
    background-color: rgba(0,0,0,0.4) !important;
    font-family: var(--font-headers);
    color: var(--accent-gold) !important;
    font-weight: 600;
}

tr:hover td {
    background-color: var(--bg-panel-hover) !important;
}

/* Remove default MyAAC table backgrounds */
.TableContainer, .InnerTableContainer {
    background: none !important;
    border: none !important;
    padding: 0 !important;
}

.CaptionContainer {
    background: rgba(0,0,0,0.4) !important;
    color: var(--accent-gold) !important;
    padding: 10px !important;
    font-family: var(--font-headers);
    border: 1px solid var(--border-color);
    border-bottom: none;
}

input[type="text"], input[type="password"], select, textarea {
    width: 100%;
    padding: 10px;
    background: rgba(0,0,0,0.3) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    border-radius: 4px;
    font-family: var(--font-text);
    box-sizing: border-box;
}

input[type="text"]:focus, input[type="password"]:focus, select:focus {
    outline: none;
    border-color: var(--accent-gold) !important;
}

input[type="submit"], button, .btn {
    background: var(--bg-panel-hover) !important;
    color: var(--accent-gold) !important;
    border: 1px solid var(--accent-gold) !important;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-headers);
    transition: all 0.2s;
    text-transform: uppercase;
    font-weight: bold;
}

input[type="submit"]:hover, button:hover, .btn:hover {
    background: var(--accent-gold) !important;
    color: var(--bg-dark) !important;
}

.error { color: #ef4444; }
.success { color: #10b981; }
.warning { color: #f59e0b; }

/* Force outfit images to behave normally inside modern tables */
td img[src*="outfit"] {
    position: relative !important;
    margin: 0 auto !important;
    display: block !important;
}

/* Responsive Design */
@media (max-width: 900px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
        gap: 15px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .site-title {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .layout-flex {
        flex-direction: column-reverse;
    }

    .char-outfit-box {
        width: 100%;
        border-left: none;
        border-bottom: 1px solid var(--border-color);
        padding-left: 0;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    .char-label, .char-value {
        width: 100%;
        display: block;
        text-align: left;
    }

    .char-row {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start !important;
    }

    .char-label {
        color: var(--accent-gold);
    }

    .char-list-row {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: left;
    }

    .char-list-action form {
        display: flex;
        justify-content: flex-start;
    }
    
    /* Allow tables to scroll horizontally on mobile instead of breaking layout */
    .main-content {
        overflow-x: auto;
    }
}

/* Fix dropdown options readability */
select option {
    background-color: var(--bg-panel);
    color: var(--text-main);
}
