/* Medieval Theme Stylesheet - Tribalwars/KingsAge/Travian Style */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap');

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

body {
    font-family: 'Crimson Text', Georgia, serif;
    background: linear-gradient(135deg, #8b6f47 0%, #6b5438 50%, #5a4632 100%);
    background-attachment: fixed;
    color: #2c1810;
    min-height: 100vh;
    position: relative;
}

/* Parchment-style background overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            rgba(139, 111, 71, 0.03) 0px,
            rgba(139, 111, 71, 0.03) 1px,
            transparent 1px,
            transparent 2px
        ),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><defs><pattern id="paper" x="0" y="0" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="0.5" fill="%23b8a082" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23paper)"/></svg>');
    pointer-events: none;
    z-index: 0;
}

header {
    background: linear-gradient(180deg, #4a3428 0%, #3d2a1f 100%);
    border-bottom: 3px solid #2c1810;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 100;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

nav a {
    color: #f4e4c1;
    text-decoration: none;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    transition: all 0.3s;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    border: 1px solid transparent;
    background: rgba(139, 111, 71, 0.2);
}

nav a:hover {
    background: linear-gradient(180deg, #8b6f47 0%, #6b5438 100%);
    border-color: #c9a769;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

nav select {
    background: rgba(139, 111, 71, 0.3);
    color: #f4e4c1;
    border: 1px solid #6b5438;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-family: 'Crimson Text', serif;
    font-size: 0.95rem;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    min-height: calc(100vh - 200px);
    position: relative;
    z-index: 1;
}

/* Parchment-style content boxes */
.content-box, .parchment {
    background: linear-gradient(180deg, #f4e4c1 0%, #e8d8b8 100%);
    border: 2px solid #8b6f47;
    border-radius: 8px;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin: 1rem 0;
    position: relative;
}

.content-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #c9a769 50%, transparent);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cinzel', Georgia, serif;
    color: #2c1810;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    border-bottom: 3px solid #8b6f47;
    padding-bottom: 0.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

/* Buttons - Medieval style */
.btn, button, input[type="submit"], a[style*="background"] {
    background: linear-gradient(180deg, #8b6f47 0%, #6b5438 100%) !important;
    color: #f4e4c1 !important;
    border: 2px solid #5a4632 !important;
    border-radius: 6px !important;
    padding: 0.75rem 1.5rem !important;
    font-family: 'Crimson Text', serif !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    box-shadow: 
        0 3px 6px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    transition: all 0.3s !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5) !important;
}

.btn:hover, button:hover, input[type="submit"]:hover, a[style*="background"]:hover {
    background: linear-gradient(180deg, #9b7f57 0%, #7b6448 100%) !important;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-2px) !important;
}

.btn-primary {
    background: linear-gradient(180deg, #c9a769 0%, #b89659 100%) !important;
    border-color: #8b6f47 !important;
}

.btn-danger {
    background: linear-gradient(180deg, #8b4a3a 0%, #6b3a2a 100%) !important;
    border-color: #5a2a1a !important;
}

/* Tables - Medieval scroll style */
table {
    width: 100%;
    border-collapse: collapse;
    background: linear-gradient(180deg, #f4e4c1 0%, #e8d8b8 100%);
    border: 2px solid #8b6f47;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

thead {
    background: linear-gradient(180deg, #6b5438 0%, #5a4632 100%);
    color: #f4e4c1;
}

thead th {
    padding: 1rem;
    text-align: left;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    border-bottom: 2px solid #8b6f47;
}

tbody tr {
    border-bottom: 1px solid #d4c4a8;
    transition: background 0.2s;
}

tbody tr:hover {
    background: rgba(201, 167, 105, 0.2);
}

tbody td {
    padding: 0.75rem 1rem;
}

/* Forms - Parchment inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    background: #f4e4c1;
    border: 2px solid #8b6f47;
    border-radius: 4px;
    padding: 0.75rem;
    font-family: 'Crimson Text', serif;
    color: #2c1810;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #c9a769;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 0 0 3px rgba(201, 167, 105, 0.2);
}

/* Secondary navigation */
.secondary-nav {
    background: linear-gradient(180deg, #5a4632 0%, #4a3428 100%);
    border-bottom: 2px solid #3d2a1f;
    padding: 0.75rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.secondary-nav a {
    background: rgba(139, 111, 71, 0.3) !important;
    border: 1px solid #6b5438 !important;
    color: #f4e4c1 !important;
}

.secondary-nav a:hover {
    background: rgba(201, 167, 105, 0.4) !important;
    border-color: #c9a769 !important;
}

/* Resource display */
.resource {
    display: inline-block;
    background: linear-gradient(180deg, #e8d8b8 0%, #d4c4a8 100%);
    border: 1px solid #8b6f47;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    margin: 0.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Building icons and graphics */
.building-icon {
    font-size: 2rem;
    margin-right: 0.5rem;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.3));
}

/* Alert/Message boxes */
.alert-success, .success-message {
    background: linear-gradient(180deg, #d4e4c8 0%, #c4d4b8 100%);
    border: 2px solid #7b9467;
    color: #2c4a1f;
    padding: 1rem;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.alert-error, .error-message {
    background: linear-gradient(180deg, #e4c4c4 0%, #d4b4b4 100%);
    border: 2px solid #946767;
    color: #4a1f1f;
    padding: 1rem;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.alert-info, .info-message {
    background: linear-gradient(180deg, #c4d4e4 0%, #b4c4d4 100%);
    border: 2px solid #677794;
    color: #1f2a4a;
    padding: 1rem;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Footer */
footer {
    background: linear-gradient(180deg, #4a3428 0%, #3d2a1f 100%);
    border-top: 3px solid #2c1810;
    color: #f4e4c1;
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 100;
}

/* Badge/Label styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
}

.badge-new {
    background: linear-gradient(180deg, #c94a4a 0%, #a93a3a 100%);
    color: #f4e4c1;
    border: 1px solid #8b2a2a;
}

.badge-read {
    color: #666;
}

/* Links */
a {
    color: #8b6f47;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #c9a769;
    text-decoration: underline;
}

/* Card/Box shadows */
.shadow-medieval {
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

/* Status indicators */
.status-traveling {
    color: #c9a769;
    font-weight: bold;
}

.status-returning {
    color: #4a7ba9;
    font-weight: bold;
}

.status-completed {
    color: #7b9467;
    font-weight: bold;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    main {
        padding: 0 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
}

