/* Ikariam Classic Theme - Ripristino look originale */
/* Palette colori ispirato a Ikariam originale */

:root {
    /* Colori principali */
    --ik-blue-dark: #1a3a52;
    --ik-blue-medium: #2c5272;
    --ik-blue-light: #3d688f;

    /* Colori dorati/bronzo per elementi UI */
    --ik-gold: #c9a227;
    --ik-gold-light: #e4c652;
    --ik-bronze: #8b7355;

    /* Colori testo e sfondo */
    --ik-text-primary: #f0e6d2;
    --ik-text-secondary: #d4c5a9;
    --ik-text: #f0e6d2;
    --ik-bg-dark: #0d1b2a;
    --ik-bg-card: #1a2f42;
    --ik-bg-panel: #233d52;
    --ik-bg-input: #0d1b2a;
    --ik-gold-dim: rgba(201, 162, 39, 0.5);

    /* Colori funzionali */
    --ik-success: #4a7c4a;
    --ik-warning: #8f6b2c;
    --ik-error: #8f3a3a;

    /* Bordi e ombre */
    --ik-border: #3d5c7a;
    --ik-shadow: rgba(0, 0, 0, 0.4);
}

/* Reset e base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.ikariam-body {
    font-family: 'Trajan Pro', 'Trajan', 'Times New Roman', Times, serif;
    background: linear-gradient(135deg, var(--ik-bg-dark) 0%, #162a3d 50%, var(--ik-bg-dark) 100%);
    color: var(--ik-text-primary);
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    line-height: 1.6;
}

/* Layout principale */
.classic-layout {
    height: 100vh;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.classic-header {
    background: linear-gradient(180deg, var(--ik-blue-dark) 0%, var(--ik-blue-medium) 100%);
    border-bottom: 2px solid var(--ik-gold);
    padding: 0.65rem 1.5rem;
    box-shadow: 0 2px 8px var(--ik-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    flex: 0 0 auto;
}

.classic-header-inner {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.classic-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.classic-logo {
    height: 42px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.classic-brand-text {
    display: flex;
    flex-direction: column;
}

.classic-app-title {
    font-size: 1.35rem;
    font-weight: bold;
    color: var(--ik-gold-light);
    letter-spacing: 0.1em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.classic-app-version {
    font-size: 0.75rem;
    color: var(--ik-text-secondary);
    font-family: Arial, sans-serif;
    letter-spacing: 0.05em;
}

.classic-user-panel {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid var(--ik-border);
}

.classic-user-name {
    font-family: Arial, sans-serif;
    font-size: 0.9rem;
    color: var(--ik-text-primary);
}

.role-badge {
    background: var(--ik-gold);
    color: var(--ik-bg-dark);
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    text-transform: uppercase;
}

/* Workspace con sidebar */
.classic-workspace {
    flex: 1 1 auto;
    display: flex;
    width: 100%;
    max-width: none;
    min-height: 0;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    overflow: hidden;
}

/* Sidebar */
.classic-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: rgba(20, 43, 62, 0.96);
    border-right: 1px solid rgba(201, 162, 39, 0.75);
    padding: 10px 0;
    box-shadow: 2px 0 6px var(--ik-shadow);
    display: flex;
    flex-direction: column;
    margin-left: 0;
    padding-left: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Menu */
.classic-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
}

.classic-menu-link,
.classic-logout-button {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 56px;
    padding: 12px 14px;
    margin: 0;
    color: #2f1f0b;
    text-decoration: none;
    border-radius: 10px;
    transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
    border: 1px solid rgba(108, 83, 42, 0.35);
    background: #f6edd5;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    font-family: 'Trajan Pro', 'Trajan', 'Times New Roman', Times, serif;
    font-size: 0.95rem;
    font-weight: 900;
}

.classic-menu-link:hover {
    background: linear-gradient(180deg, rgba(232, 241, 224, 0.96), rgba(255, 248, 232, 0.96));
    border-color: rgba(91, 111, 79, 0.72);
    color: #2f1f0b;
    box-shadow:
        inset 0 0 0 2px rgba(91, 111, 79, 0.16),
        0 10px 22px rgba(0, 0, 0, 0.20);
    transform: translateY(-1px);
}

.classic-menu-link.active {
    background: #f6edd5;
    border-color: rgba(108, 83, 42, 0.35);
    color: #2f1f0b;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.classic-menu-link.active:hover {
    background: linear-gradient(180deg, rgba(232, 241, 224, 0.96), rgba(255, 248, 232, 0.96));
    border-color: rgba(91, 111, 79, 0.72);
    color: #2f1f0b;
    box-shadow:
        inset 0 0 0 2px rgba(91, 111, 79, 0.16),
        0 10px 22px rgba(0, 0, 0, 0.20);
}

.menu-icon {
    font-size: 1.2rem;
    width: 24px;
    min-width: 24px;
    text-align: center;
    filter: grayscale(1) saturate(0) contrast(1.25);
}

.menu-text {
    flex: 1;
}

.menu-logout-wrapper {
    margin-top: auto;
    padding: 10px;
    border-top: 1px solid rgba(201, 162, 39, 0.35);
}

.classic-logout-form {
    width: 100%;
    padding: 0;
    margin: 0;
}

.classic-logout-button {
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 12px 14px;
    margin: 0;
    background: #f6edd5;
    border: 1px solid rgba(108, 83, 42, 0.35);
    color: #2f1f0b;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Trajan Pro', 'Trajan', 'Times New Roman', Times, serif;
    font-size: 0.95rem;
    font-weight: 900;
    line-height: 1.2;
    text-align: left;
    transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.classic-logout-button:hover {
    background: linear-gradient(180deg, rgba(232, 241, 224, 0.96), rgba(255, 248, 232, 0.96));
    border-color: rgba(91, 111, 79, 0.72);
    color: #2f1f0b;
    box-shadow:
        inset 0 0 0 2px rgba(91, 111, 79, 0.16),
        0 10px 22px rgba(0, 0, 0, 0.20);
    transform: translateY(-1px);
}

.logout-icon {
    font-size: 1.2rem;
    width: 24px;
    min-width: 24px;
    text-align: center;
    filter: grayscale(1) saturate(0) contrast(1.25);
}

.logout-text {
    flex: 1;
    text-align: left;
}

/* Main content area */
.classic-main {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    background: transparent;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

.classic-page-shell {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    padding: 12px;
    min-height: 100%;
    overflow: visible;
    box-sizing: border-box;
}

/* Footer */
.classic-footer {
    background: var(--ik-bg-card);
    border-top: 2px solid var(--ik-gold);
    padding: 1rem 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--ik-text-secondary);
    font-family: Arial, sans-serif;
}

/* Dashboard panel */
.dashboard-panel {
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    box-sizing: border-box;
}

.dashboard-section {
    width: 100%;
    box-sizing: border-box;
    border-radius: 12px;
    border: 1px solid rgba(201, 162, 39, 0.65);
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    background: rgba(26, 47, 66, 0.96);
}

.dashboard-section-title {
    background: linear-gradient(180deg, rgba(44, 82, 114, 0.95) 0%, rgba(26, 58, 82, 0.95) 100%);
    padding: 0.85rem 1.15rem;
    font-size: 1rem;
    letter-spacing: 0.02em;
    color: var(--ik-gold-light);
    border-bottom: 1px solid var(--ik-gold);
    font-family: 'Trajan Pro', 'Trajan', 'Times New Roman', Times, serif;
}

.dashboard-section-body {
    padding: 1.25rem 1.15rem;
    font-family: Arial, sans-serif;
    font-size: 0.95rem;
    color: var(--ik-text-primary);
    line-height: 1.75;
    white-space: pre-line;
}

/* Error page */
.error-page {
    max-width: 500px;
    margin: 4rem auto;
    padding: 2rem;
    background: var(--ik-bg-card);
    border: 1px solid var(--ik-error);
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 12px var(--ik-shadow);
}

.error-page h2 {
    color: var(--ik-error);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-family: 'Trajan Pro', 'Trajan', 'Times New Roman', Times, serif;
}

.error-page p {
    font-family: Arial, sans-serif;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    color: var(--ik-text-primary);
}

/* Links */
a.classic-menu-link {
    color: #2f1f0b;
}

a.classic-menu-link:hover {
    color: #2f1f0b;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    body.ikariam-body {
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .classic-layout {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .classic-header-inner {
        flex-direction: column;
        gap: 1rem;
    }

    .classic-workspace {
        flex-direction: column;
        min-height: auto;
        overflow: visible;
    }

    .classic-sidebar {
        width: 100%;
        flex: 0 0 auto;
        padding: 1rem 0;
        border-right: none;
        border-bottom: 2px solid var(--ik-gold);
        overflow: visible;
    }

    .classic-main {
        width: 100%;
        flex: 0 0 auto;
        min-height: auto;
        overflow: visible;
    }

    .classic-page-shell {
        padding: 1rem;
        min-height: auto;
    }
}

/* Utility classes per i tool */
.tool-title {
    font-size: 1.8rem;
    color: var(--ik-gold-light);
    margin-bottom: 1.5rem;
    text-align: center;
    font-family: 'Trajan Pro', 'Trajan', 'Times New Roman', Times, serif;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.tool-description {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--ik-text-secondary);
    font-family: Arial, sans-serif;
}

/* Form styles */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--ik-gold-light);
    font-family: Arial, sans-serif;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    background: var(--ik-bg-dark);
    border: 1px solid var(--ik-border);
    border-radius: 4px;
    color: var(--ik-text-primary);
    font-family: Arial, sans-serif;
    font-size: 0.9rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--ik-gold);
    box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.2);
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: var(--ik-blue-medium);
    border: 1px solid var(--ik-gold);
    color: var(--ik-text-primary);
    border-radius: 4px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn:hover {
    background: var(--ik-blue-light);
    box-shadow: 0 0 10px rgba(201, 162, 39, 0.3);
}

.btn-primary {
    background: var(--ik-gold);
    color: var(--ik-bg-dark);
    font-weight: bold;
}

.btn-primary:hover {
    background: var(--ik-gold-light);
}

/* Cards and panels */
.card {
    background: var(--ik-bg-card);
    border: 1px solid var(--ik-border);
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px var(--ik-shadow);
}

.card-header {
    font-size: 1.2rem;
    color: var(--ik-gold-light);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--ik-border);
    font-family: 'Trajan Pro', 'Trajan', 'Times New Roman', Times, serif;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin-bottom: 1rem;
    border: 1px solid var(--ik-border);
    border-radius: 4px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--ik-bg-card);
    border: none;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--ik-border);
    font-family: Arial, sans-serif;
    font-size: 0.9rem;
}

.table th {
    background: linear-gradient(180deg, var(--ik-blue-medium) 0%, var(--ik-blue-dark) 100%);
    color: var(--ik-gold-light);
    font-weight: bold;
    font-family: 'Trajan Pro', 'Trajan', 'Times New Roman', Times, serif;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-size: 0.85rem;
    border-bottom: 2px solid var(--ik-gold);
}

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

.table tr:hover {
    background: var(--ik-bg-panel);
}

/* Table footer/summary rows */
.table tfoot td {
    background: var(--ik-blue-dark);
    font-weight: bold;
    color: var(--ik-gold-light);
    border-top: 2px solid var(--ik-gold);
}

/* Badge/label styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-family: Arial, sans-serif;
}

.badge-success {
    background: var(--ik-success);
    color: white;
}

.badge-warning {
    background: var(--ik-warning);
    color: white;
}

.badge-error {
    background: var(--ik-error);
    color: white;
}

/* Server selector */
.server-selector-wrapper {
    width: 100%;
    min-height: 56px;
    margin: 0;
    padding: 12px 14px;
    box-sizing: border-box;
    background: #f6edd5;
    border: 1px solid rgba(108, 83, 42, 0.35);
    border-radius: 10px;
    color: #2f1f0b;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.server-selector-wrapper:hover {
    background: linear-gradient(180deg, rgba(232, 241, 224, 0.96), rgba(255, 248, 232, 0.96));
    border-color: rgba(91, 111, 79, 0.72);
    box-shadow:
        inset 0 0 0 2px rgba(91, 111, 79, 0.16),
        0 10px 22px rgba(0, 0, 0, 0.20);
    transform: translateY(-1px);
}

.server-selector-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.server-selector-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 24px;
    font-family: 'Trajan Pro', 'Trajan', 'Times New Roman', Times, serif;
    font-size: 0.95rem;
    color: #2f1f0b;
    letter-spacing: normal;
    text-transform: none;
    font-weight: 900;
}


.server-selector-icon {
    font-size: 1.2rem;
    width: 24px;
    min-width: 24px;
    text-align: center;
    filter: grayscale(1) saturate(0) contrast(1.25);
}

.server-selector-text {
    flex: 1;
    color: #2f1f0b;
}

.server-selector {
    width: 100%;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: rgba(13, 27, 42, 0.92);
    border: 1px solid rgba(47, 31, 11, 0.45);
    border-radius: 4px;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-family: 'Trajan Pro', 'Trajan', 'Times New Roman', Times, serif;
    font-size: 0.9rem;
    color: #fff7e8;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23c9a227' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.server-selector:hover {
    border-color: rgba(91, 111, 79, 0.72);
    background-color: rgba(13, 27, 42, 0.96);
}

.server-selector:focus {
    outline: none;
    border-color: rgba(91, 111, 79, 0.72);
    box-shadow: 0 0 0 2px rgba(91, 111, 79, 0.22);
    background-color: rgba(13, 27, 42, 0.96);
}

.server-selector option {
    background: var(--ik-bg-panel);
    color: var(--ik-text);
    padding: 0.5rem;
}

.server-selector:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Sidebar uniform card width */
.classic-menu {
    width: 100%;
    box-sizing: border-box;
}

.classic-menu-link,
.classic-logout-button,
.server-selector-wrapper {
    width: 100%;
    box-sizing: border-box;
}

.classic-logout-form {
    width: 100%;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

