/* Modern Medieval Theme for Red Dragon Inn */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Lato:wght@300;400;700&display=swap');

:root {
    --dragon-red: #8B0000;
    --fire-orange: #FF6B35;
    --gold: #FFD700;
    --dark-wood: #2C1810;
    --aged-paper: #F4E4C1;
    --stone-gray: #4A4A4A;
    --torch-glow: #FFA500;
    --shadow: rgba(0, 0, 0, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lato', sans-serif;
    color: var(--aged-paper);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(139, 0, 0, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(255, 107, 53, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #1a0f0a 0%, #2C1810 50%, #1a0f0a 100%);
    z-index: -2;
}

/* Animated floating particles (embers) */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, rgba(255, 165, 0, 0.4), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(255, 107, 53, 0.3), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255, 215, 0, 0.4), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(255, 165, 0, 0.3), transparent),
        radial-gradient(2px 2px at 90% 60%, rgba(139, 0, 0, 0.3), transparent),
        radial-gradient(1px 1px at 33% 90%, rgba(255, 215, 0, 0.3), transparent);
    background-size: 200% 200%;
    animation: floatingEmbers 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes floatingEmbers {
    0%, 100% { 
        background-position: 0% 0%, 100% 100%, 50% 50%, 80% 10%, 10% 90%, 70% 30%;
        opacity: 0.3;
    }
    50% { 
        background-position: 100% 100%, 0% 0%, 25% 75%, 60% 80%, 90% 10%, 30% 70%;
        opacity: 0.6;
    }
}

/* Main Panel Container */
.medieval-panel {
    background: linear-gradient(135deg, rgba(44, 24, 16, 0.95) 0%, rgba(60, 35, 20, 0.98) 100%);
    backdrop-filter: blur(10px);
    border: 3px solid transparent;
    border-radius: 20px;
    max-width: 900px;
    margin: 40px auto;
    padding: 40px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.9),
        inset 0 1px 0 rgba(255, 215, 0, 0.1),
        0 0 100px rgba(139, 0, 0, 0.3);
    position: relative;
    animation: panelGlow 3s ease-in-out infinite;
}

@keyframes panelGlow {
    0%, 100% {
        box-shadow: 
            0 20px 60px rgba(0, 0, 0, 0.9),
            inset 0 1px 0 rgba(255, 215, 0, 0.1),
            0 0 80px rgba(139, 0, 0, 0.3);
    }
    50% {
        box-shadow: 
            0 20px 60px rgba(0, 0, 0, 0.9),
            inset 0 1px 0 rgba(255, 215, 0, 0.2),
            0 0 120px rgba(255, 107, 53, 0.4);
    }
}

.medieval-panel::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, var(--dragon-red), var(--fire-orange), var(--gold), var(--fire-orange), var(--dragon-red));
    background-size: 300% 300%;
    border-radius: 20px;
    z-index: -1;
    animation: borderGlow 6s linear infinite;
}

@keyframes borderGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Headers */
h2 {
    font-family: 'Cinzel', serif;
    font-size: 2.5em;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    color: var(--gold);
    text-shadow: 
        0 0 20px rgba(255, 215, 0, 0.8),
        0 0 40px rgba(255, 107, 53, 0.5),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 3px;
}

h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.5em;
    color: var(--fire-orange);
    margin: 25px 0 15px 0;
    text-shadow: 0 2px 10px rgba(255, 107, 53, 0.5);
    border-bottom: 2px solid rgba(255, 107, 53, 0.3);
    padding-bottom: 8px;
}

/* Medieval Divider */
.medieval-divider {
    height: 30px;
    margin: 25px 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--gold) 20%, 
        var(--fire-orange) 50%, 
        var(--gold) 80%, 
        transparent 100%);
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 20"><path d="M0,10 Q25,0 50,10 T100,10 T150,10 T200,10" fill="none" stroke="black" stroke-width="3"/><circle cx="50" cy="10" r="3"/><circle cx="100" cy="10" r="4"/><circle cx="150" cy="10" r="3"/></svg>') center/contain no-repeat;
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 20"><path d="M0,10 Q25,0 50,10 T100,10 T150,10 T200,10" fill="none" stroke="black" stroke-width="3"/><circle cx="50" cy="10" r="3"/><circle cx="100" cy="10" r="4"/><circle cx="150" cy="10" r="3"/></svg>') center/contain no-repeat;
    opacity: 0.7;
}

/* Form Elements */
input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(20, 10, 5, 0.8);
    border: 2px solid rgba(255, 107, 53, 0.3);
    border-radius: 8px;
    color: var(--aged-paper);
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-bottom: 12px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--fire-orange);
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.4);
    background: rgba(20, 10, 5, 0.95);
}

/* Buttons */
button,
input[type="submit"] {
    background: linear-gradient(135deg, var(--dragon-red) 0%, var(--fire-orange) 100%);
    color: var(--aged-paper);
    border: 2px solid rgba(255, 215, 0, 0.3);
    padding: 12px 24px;
    border-radius: 10px;
    font-family: 'Cinzel', serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before {
    width: 300px;
    height: 300px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.6);
    border-color: var(--gold);
}

button:active {
    transform: translateY(0);
}

/* Chips & Tags */
.chip {
    display: inline-block;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.6) 0%, rgba(60, 35, 20, 0.8) 100%);
    color: var(--gold);
    border: 1px solid rgba(255, 107, 53, 0.4);
    border-radius: 20px;
    padding: 6px 14px;
    margin: 4px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.chip:hover {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.8) 0%, rgba(60, 35, 20, 1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

/* Stats Display */
.stats,
.stats-quick,
.stats-panel {
    background: linear-gradient(135deg, rgba(20, 10, 5, 0.9) 0%, rgba(40, 25, 15, 0.9) 100%);
    padding: 15px 20px;
    border-radius: 12px;
    border: 2px solid rgba(255, 107, 53, 0.3);
    margin: 15px 0;
    font-weight: 500;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    padding: 5px 0;
}

/* Room Description */
.room-desc {
    background: rgba(40, 25, 15, 0.6);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--fire-orange);
    margin: 20px 0;
    font-size: 16px;
    line-height: 1.6;
    font-style: italic;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

/* Action Panels */
.action-panel,
.admin-section {
    background: linear-gradient(135deg, rgba(30, 15, 10, 0.8) 0%, rgba(50, 30, 20, 0.8) 100%);
    padding: 20px;
    margin: 20px 0;
    border-radius: 15px;
    border: 2px solid rgba(255, 107, 53, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* Monster Cards */
.monster-card {
    background: linear-gradient(135deg, rgba(80, 20, 20, 0.9) 0%, rgba(40, 10, 10, 0.9) 100%);
    padding: 16px;
    margin: 12px 0;
    border-radius: 12px;
    border: 2px solid rgba(139, 0, 0, 0.6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.monster-card:hover {
    transform: translateX(5px);
    border-color: var(--fire-orange);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.5);
}

.monster-name {
    font-family: 'Cinzel', serif;
    font-weight: bold;
    color: #ffaaaa;
    font-size: 1.3em;
    text-shadow: 0 2px 8px rgba(255, 0, 0, 0.5);
}

/* Health Bar */
.health-bar {
    background: rgba(20, 5, 5, 0.9);
    height: 12px;
    border-radius: 6px;
    margin: 8px 0;
    overflow: hidden;
    border: 1px solid rgba(139, 0, 0, 0.6);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.health-fill {
    background: linear-gradient(90deg, var(--dragon-red) 0%, var(--fire-orange) 50%, #ff4444 100%);
    height: 100%;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.8);
    position: relative;
    overflow: hidden;
}

.health-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Item Cards */
.item-card {
    background: linear-gradient(135deg, rgba(40, 25, 15, 0.9) 0%, rgba(60, 40, 25, 0.9) 100%);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    padding: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.item-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    transition: all 0.5s ease;
    opacity: 0;
}

.item-card:hover::before {
    opacity: 1;
    animation: itemGlow 2s infinite;
}

@keyframes itemGlow {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10%, 10%); }
}

.item-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--gold);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

.item-card.equipped {
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(60, 40, 15, 0.95) 0%, rgba(80, 60, 35, 0.95) 100%);
    box-shadow: 
        0 6px 20px rgba(255, 215, 0, 0.4),
        inset 0 0 20px rgba(255, 215, 0, 0.1);
}

.item-card h4 {
    font-family: 'Cinzel', serif;
    margin: 0 0 8px 0;
    color: var(--gold);
    font-size: 1.2em;
}

.item-type {
    display: inline-block;
    background: rgba(139, 0, 0, 0.5);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 4px 4px 4px 0;
    border: 1px solid rgba(255, 107, 53, 0.3);
}

/* Messages */
.msg,
.msg-box {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 12px;
    border-left: 4px solid;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.msg.success {
    background: rgba(45, 80, 22, 0.9);
    border-color: #4a8028;
    color: #b8ffb8;
}

.msg.error {
    background: rgba(93, 22, 22, 0.9);
    border-color: #8b2828;
    color: #ffb8b8;
}

.msg.info,
.msg-box {
    background: rgba(45, 64, 80, 0.9);
    border-color: #6699cc;
    color: #aaddff;
}

/* Links */
a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--fire-orange);
    transition: width 0.3s ease;
}

a:hover::after {
    width: 100%;
}

a:hover {
    color: var(--fire-orange);
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.tab {
    padding: 12px 24px;
    background: rgba(40, 25, 15, 0.6);
    cursor: pointer;
    border-radius: 10px 10px 0 0;
    border: 2px solid rgba(255, 107, 53, 0.3);
    border-bottom: none;
    transition: all 0.3s ease;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    color: var(--aged-paper);
}

.tab:hover {
    background: rgba(60, 35, 20, 0.8);
    transform: translateY(-2px);
}

.tab.active {
    background: linear-gradient(135deg, rgba(60, 35, 20, 0.95) 0%, rgba(80, 50, 30, 0.95) 100%);
    border-color: var(--gold);
    color: var(--gold);
    box-shadow: 0 -3px 15px rgba(255, 215, 0, 0.3);
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: rgba(20, 10, 5, 0.5);
    border-radius: 10px;
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 12px;
    border: 1px solid rgba(255, 107, 53, 0.2);
    text-align: left;
}

.data-table th {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.6) 0%, rgba(60, 30, 15, 0.8) 100%);
    color: var(--gold);
    font-family: 'Cinzel', serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.data-table tr:hover {
    background: rgba(60, 35, 20, 0.5);
}

/* Chat */
#lobbyChat {
    background: rgba(20, 10, 5, 0.9);
    min-height: 150px;
    max-height: 250px;
    overflow-y: auto;
    padding: 15px;
    border-radius: 12px;
    border: 2px solid rgba(255, 107, 53, 0.3);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
    line-height: 1.6;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(20, 10, 5, 0.8);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--dragon-red), var(--fire-orange));
    border-radius: 10px;
    border: 2px solid rgba(20, 10, 5, 0.8);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--fire-orange), var(--gold));
}

/* Responsive Design */
@media (max-width: 768px) {
    .medieval-panel {
        margin: 20px;
        padding: 25px;
    }
    
    h2 {
        font-size: 2em;
    }
    
    .stats-quick {
        flex-direction: column;
        gap: 8px;
    }
    
    .monster-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tabs {
        justify-content: center;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Inventory Grid */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

/* Direction Buttons */
.direction-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 15px 0;
}

/* Form Rows */
.form-row {
    margin-bottom: 15px;
}

.form-row label {
    display: inline-block;
    width: 150px;
    color: var(--gold);
    font-weight: 500;
}

/* Loot Items */
.loot-items {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0;
}

/* Login specific styles */
body.bg-login .medieval-panel {
    margin-top: 100px;
    max-width: 500px;
}