/* =========================================
   TIBIAME CLONE COMPLETE DESIGN SYSTEM
   Multi-page website design based on tibiame.com
   ========================================= */

/* --- CSS Variables / Design Tokens --- */
:root {
    /* Core colors from Tibiame original */
    --bg-dark: #003456;
    --bg-medium: #3469A2;
    --bg-light: #EBEEFF;
    --accent-blue: #408ae4;
    --accent-dark: #2C4D60;
    --border-color: #7EA7CB;
    --border-dark: #4f80b1;
    --text-dark: #000000;
    --text-white: #ffffff;
    --text-link: #5E87AB;
    --text-link-hover: #3E678B;
    --button-bg: #3C76AA;
    --status-online: #008000;
    --status-maintenance: #ff0000;
    --button-hover: #2a5a88;
    --header-gradient-start: #003456;
    --header-gradient-end: #005580;

    /* Typography */
    --font-main: 'Verdana', sans-serif;
    --font-mono: 'Courier New', Courier, monospace;

    /* Layout dimensions */
    --container-width: 1000px;
    --header-height: 170px;
    --sidebar-width: 180px;
    --content-width: 590px;
    --border-radius: 4px;
    --transition: all 0.3s ease;

    /* Z-index */
    --z-header: 100;
    --z-modal: 200;
}

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

html {
    overflow-y: scroll;
}

body {
    position: relative;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100vw;
    text-align: center;
    font-family: var(--font-main);
    font-size: 12px;
    background-color: var(--bg-dark);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: var(--transition);
}

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

a:focus {
    outline: none;
}

a:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

label {
    cursor: pointer;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Main Container --- */
#BodyContainer {
    position: relative;
    max-width: var(--container-width);
    margin: 0 auto;
    text-align: left;
    background-color: var(--bg-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--accent-blue);
    color: var(--text-white);
    padding: 10px;
    z-index: 1000;
    transition: top 0.3s;
    text-decoration: none;
    font-weight: bold;
}

.skip-link:focus {
    top: 0;
}

/* =========================================
   HEADER AREA
   ========================================= */
#Header {
    height: var(--header-height);
    width: 100%;
    background: linear-gradient(135deg, var(--header-gradient-start) 0%, var(--header-gradient-end) 100%);
    background-position: left top;
    background-repeat: no-repeat;
    overflow: visible;
    position: relative;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Header background image overlay */
#Header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('https://static.tibiame.com/content/images/master/header_background_highres_07.png');
    background-size: cover;
    background-position: center;
    opacity: 0.25;
    z-index: 0;
    pointer-events: none;
}

#Header > * {
    position: relative;
    z-index: 1;
}

/* Header Monster Elements */
#MonsterLeft,
#MonsterRight {
    position: absolute;
    background-repeat: no-repeat;
    z-index: 0;
}

#MonsterLeft {
    top: 10px;
    left: -40px;
    height: 165px;
    width: 270px;
    background-image: url('https://static.tibiame.com/content/images/master/headermonster/headermonster_left_07.png');
}

#MonsterRight {
    top: 30px;
    right: -40px;
    height: 130px;
    width: 270px;
    background-image: url('https://static.tibiame.com/content/images/master/headermonster/headermonster_right_02.png');
}

/* Header Action Buttons */
.header-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.ButtonBig {
    display: block;
    position: relative;
    width: 141px;
    height: 30px;
    cursor: pointer;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    border: none;
    transition: var(--transition);
    z-index: 2;
}

.ButtonBig:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.ButtonBig:active {
    transform: scale(0.95);
}

#ButtonDownload {
    background-image: url('https://static.tibiame.com/content/images/language/buttons/ButtonDownload_en.png');
}

#ButtonPlay {
    background-image: url('https://static.tibiame.com/content/images/language/buttons/ButtonPlay_en.png');
}

#ButtonPayment {
    background-image: url('https://static.tibiame.com/content/images/language/buttons/ButtonPayment_en.png');
}

/* Header Select Containers */
.header-selects {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: auto;
}

#Header .SelectContainer {
    margin: 5px;
}

#Header select {
    width: 100px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-white);
    background-color: var(--button-bg);
    border: none;
    padding: 6px 8px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

#Header select:hover {
    background-color: var(--button-hover);
}

#Header select:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* =========================================
   CONTENT AREA (3 Column Layout)
   ========================================= */
#Content {
    position: relative;
    width: 100%;
    flex: 1;
    clear: both;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-start;
}

/* --- Left Column (Navigation) --- */
#LeftColumn {
    width: var(--sidebar-width);
    padding-right: 20px;
    flex-shrink: 0;
}

/* --- Middle Column (Main Content) --- */
#MiddleColumn {
    flex: 1;
    min-width: 280px;
    margin-left: 5px;
}

/* --- Right Column (Sidebar) --- */
#RightColumn {
    width: var(--sidebar-width);
    padding-left: 20px;
    flex-shrink: 0;
}

/* Sub Menu Bar */
#SubMenu {
    height: 30px;
    width: 100%;
    margin-bottom: 15px;
    background-color: var(--accent-blue);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

#SubMenu .SubMenuItem {
    text-align: center;
    color: var(--text-white);
    font-weight: bold;
    font-size: 11px;
    padding: 5px 12px;
    cursor: pointer;
    transition: var(--transition);
    border-radius: var(--border-radius);
}

#SubMenu .SubMenuItem:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Page Content */
#PageContent {
    background-color: var(--bg-light);
    padding: 30px;
    border-left: 3px solid var(--border-dark);
    border-right: 3px solid var(--border-dark);
    border-bottom: 3px solid var(--border-dark);
    border-top: 3px solid var(--border-dark);
    border-radius: var(--border-radius);
    font-size: 12px;
    min-height: 400px;
}

#PageContent p {
    margin-top: 12px;
    margin-bottom: 12px;
}

#PageContent a {
    color: var(--text-link);
    text-decoration: none;
}

#PageContent a:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}

#PageContent h1 {
    position: relative;
    height: 40px;
    background-image: url('https://static.tibiame.com/content/images/master/content_headline.gif');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left center;
    color: var(--accent-dark);
    padding-left: 70px;
    font-size: 24px;
    margin: 0 0 20px 0;
    line-height: 40px;
}

#PageContent h2 {
    font-size: 18px;
    color: var(--accent-dark);
    margin: 20px 0 10px 0;
}

#PageContent table {
    border: 1px solid var(--border-color);
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 20px;
    background-color: var(--text-white);
    border-radius: var(--border-radius);
    overflow: hidden;
}

#PageContent th {
    height: 25px;
    padding: 4px 8px;
    border-bottom: 1px solid #5F8490;
    background-image: url('https://static.tibiame.com/content/images/master/content_th.gif');
    background-repeat: repeat-x;
    color: var(--accent-dark);
    text-align: center;
    font-weight: bold;
    font-size: 12px;
}

#PageContent td {
    vertical-align: top;
    padding: 8px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 11px;
}

#PageContent tr:last-child td {
    border-bottom: none;
}

#PageContent textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: var(--font-main);
    font-size: 11px;
    resize: vertical;
}

.BigContentBottomImage {
    width: 100%;
    max-width: 584px;
    height: auto;
    margin: 20px 0;
    border-radius: var(--border-radius);
}

/* =========================================
   FRAME BOXES
   ========================================= */
.FrameBox {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    background-color: var(--bg-medium);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.6s ease-out;
}

.FrameBox .FrameBoxHeader {
    height: 30px;
    background-image: url('https://static.tibiame.com/content/images/master/box_header.png');
    background-size: cover;
    background-position: center;
}

.FrameBox .FrameBoxFooter {
    height: 12px;
    background-image: url('https://static.tibiame.com/content/images/master/box_footer.png');
    background-size: cover;
    background-position: center;
}

.FrameBox .FrameBoxHeadline {
    position: absolute;
    top: 5px;
    left: 5px;
    height: 25px;
    width: calc(100% - 10px);
    display: flex;
    align-items: center;
    padding-left: 10px;
    color: var(--text-white);
    font-weight: bold;
    font-size: 12px;
    background-image: url('https://static.tibiame.com/content/images/master/box_menu.png');
    background-size: cover;
    background-position: center;
}

#BoxScreenshot .FrameBoxHeadline {
    background-image: url('https://static.tibiame.com/content/images/master/box_screenshot.png');
}

#BoxMenu .FrameBoxHeadline {
    background-image: url('https://static.tibiame.com/content/images/master/box_menu.png');
}

#BoxiPhone .FrameBoxHeadline {
    background-image: url('https://static.tibiame.com/content/images/master/box_menu.png');
}

#BoxAndroid .FrameBoxHeadline {
    background-image: url('https://static.tibiame.com/content/images/master/box_menu.png');
}

.FrameBox .FrameBoxContentBackground {
    background: var(--bg-medium);
    padding: 15px;
}

.FrameBoxContent {
    position: relative;
    width: 100%;
    color: var(--text-white);
}

/* Main Menu Links */
.MainMenu {
    display: block;
    width: 100%;
    height: 35px;
    margin-bottom: 5px;
    background-repeat: no-repeat;
    background-position: center left;
    padding-left: 45px;
    line-height: 35px;
    font-size: 11px;
    color: var(--text-white);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border-radius: var(--border-radius);
}

.MainMenu:hover {
    background-color: rgba(255, 255, 255, 0.1);
    padding-left: 50px;
}

.MainMenu:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

.MainMenu.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: bold;
}

#MainMenuList {
    list-style: none;
}

/* List Items */
.ListItemEven,
.ListItemOdd {
    display: block;
    margin: 5px 0;
    padding: 8px;
    border-radius: var(--border-radius);
}

.ListItemEven {
    background-color: rgba(255, 255, 255, 0.05);
}

.ListItemOdd {
    background-color: rgba(255, 255, 255, 0.1);
}

/* =========================================
   FOOTER
   ========================================= */
#Footer {
    background-color: var(--bg-dark);
    color: var(--text-white);
    text-align: center;
    padding: 20px;
    font-size: 11px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

#Footer p {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-link);
    text-decoration: none;
    margin: 0 8px;
    font-size: 11px;
}

.footer-links a:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}

.separator {
    color: var(--text-white);
    margin: 0 2px;
}

/* =========================================
   PREMIUM SECTION
   ========================================= */
.PremiumSection {
    background: linear-gradient(135deg, var(--bg-medium), var(--accent-blue));
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 20px 0;
    color: var(--text-white);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.PremiumSection h2 {
    color: var(--text-white);
    margin-bottom: 15px;
    font-size: 18px;
}

.PremiumSection p {
    color: var(--text-white);
    margin-bottom: 15px;
}

.PremiumList {
    list-style: none;
    padding-left: 0;
    margin-bottom: 15px;
}

.PremiumList li {
    margin: 8px 0;
    padding-left: 30px;
    position: relative;
    font-size: 12px;
}

.PremiumList li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: #ffd700;
    font-size: 14px;
}

.btn-premium {
    display: inline-block;
    background-color: var(--button-bg);
    color: var(--text-white);
    padding: 6px 12px;
    border-radius: var(--border-radius);
    font-weight: bold;
    font-size: 12px;
}

.btn-premium:hover {
    background-color: var(--button-hover);
    color: var(--text-white);
    text-decoration: none;
}

/* =========================================
   WORLD TABLES
   ========================================= */
.worlds-table {
    margin-top: 15px;
}

.status-online {
    color: var(--status-online);
    font-weight: bold;
}

.status-maintenance {
    color: var(--status-maintenance);
    font-weight: bold;
}

/* =========================================
   NEWS BOX
   ========================================= */
.HomeNewsBox {
    border: 1px solid var(--border-color);
    width: 100%;
    margin-bottom: 10px;
    background-color: var(--text-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-top: 20px;
}

#PageContent .HomeNewsDate {
    text-align: right;
    font-size: 10px;
    color: var(--accent-dark);
    padding: 5px 10px;
    background-color: #f0f0f0;
}

#PageContent .HomeNewsHeadline {
    text-align: left;
    font-weight: bold;
    color: var(--accent-dark);
    padding: 8px 10px;
    font-size: 14px;
}

.HomeNewsTicker {
    font-size: 10px;
    font-style: italic;
    margin: 0;
    padding: 5px 10px;
    color: #666;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.HomeNewsBody {
    padding: 10px;
}

.HomeNewsBody img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
}

/* =========================================
   STORE BADGES
   ========================================= */
.store-badge {
    width: 100%;
    max-width: 135px;
    height: auto;
    margin: 10px auto;
    display: block;
}

.screenshot-thumb {
    width: 176px;
    height: 176px;
    object-fit: cover;
    border: none;
    margin: 10px auto;
    display: block;
}

/* =========================================
   UTILITY CLASSES
   ========================================= */
.ButtonsPremium {
    display: block;
    height: 17px;
    width: 80px;
    cursor: pointer;
    margin: 10px auto;
}

#ButtonReseller {
    background-image: url('https://static.tibiame.com/content/images/master/ButtonReseller.png');
}

#ButtonElement5 {
    background-image: url('https://static.tibiame.com/content/images/master/ButtonElement5.png');
}

.Bold {
    font-weight: bold;
}

.Green {
    color: var(--status-online);
}

.Red {
    color: var(--status-maintenance);
}

.Crumb {
    font-size: 10px;
}

.HeaderIcon {
    vertical-align: middle;
    margin-right: 8px;
    width: 24px;
    height: 24px;
}

.BoxNewsTicker {
    font-size: 10px;
    font-style: italic;
    margin: 0;
    padding: 3px;
}

.BoxNewsBody {
    font-size: 10px;
    margin: 0;
    padding: 3px;
}

/* Navigation Container */
.NavigationContainer {
    height: 35px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
}

.NavigationLeft,
.NavigationCenter,
.NavigationRight {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
}

.NavigationLeft {
    justify-content: flex-start;
    padding-left: 10px;
}

.NavigationCenter {
    justify-content: center;
}

.NavigationRight {
    justify-content: flex-end;
    padding-right: 10px;
}

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 1024px) {
    #Header {
        height: auto;
        padding: 30px 20px;
    }

    #MonsterLeft,
    #MonsterRight {
        display: none;
    }

    .ButtonBig {
        position: static;
        margin: 5px auto;
        width: 130px;
        height: 28px;
    }

    .header-selects {
        margin-top: 20px;
    }

    #BodyContainer {
        width: 100%;
        padding: 0;
    }
}

@media (max-width: 768px) {
    #Content {
        flex-direction: column;
        padding: 15px;
    }

    #LeftColumn,
    #RightColumn {
        width: 100%;
        padding: 0;
    }

    #MiddleColumn {
        margin-left: 0;
        width: 100%;
    }

    #PageContent {
        padding: 20px;
        border-width: 2px;
    }

    #PageContent h1 {
        padding-left: 50px;
        font-size: 20px;
    }

    .FrameBox {
        width: 100%;
    }

    #SubMenu {
        flex-direction: column;
        height: auto;
        padding: 10px 0;
        gap: 5px;
    }

    #SubMenu .SubMenuItem {
        width: 100%;
        text-align: center;
        padding: 8px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 11px;
    }

    #Header {
        padding: 20px 15px;
    }

    .ButtonBig {
        width: 100%;
        max-width: 141px;
    }

    #PageContent {
        padding: 15px;
    }

    #PageContent h1 {
        font-size: 18px;
        padding-left: 40px;
    }

    #PageContent table {
        font-size: 10px;
    }

    #PageContent th,
    #PageContent td {
        padding: 6px 4px;
    }
}

/* =========================================
   FORUM STYLES
   ========================================= */
.forum-forums-table,
.forum-topics-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.forum-forums-table th,
.forum-forums-table td,
.forum-topics-table th,
.forum-topics-table td {
    padding: 8px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
}

.forum-forums-table th,
.forum-topics-table th {
    background-color: var(--bg-medium);
    color: var(--text-white);
    text-align: left;
}

.gensmall {
    font-size: 10px;
    color: #666;
}

.post {
    background-color: var(--text-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    overflow: hidden;
}

.post-header {
    background-color: #f0f0f0;
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.post-author {
    font-weight: bold;
    color: var(--accent-dark);
}

.post-date {
    font-size: 11px;
    color: #666;
}

.post-level {
    font-size: 10px;
    color: var(--text-link);
    background-color: var(--bg-light);
    padding: 2px 6px;
    border-radius: var(--border-radius);
}

.post-body {
    padding: 12px;
    line-height: 1.6;
}

.post-body p {
    margin: 0 0 10px 0;
}

.post-body ul {
    margin: 10px 0;
    padding-left: 25px;
}

.post-actions {
    padding: 8px 12px;
    background-color: #f8f8f8;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
}

.btn-reply,
.btn-quote,
.btn-edit {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--bg-medium);
    color: var(--text-white);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: 11px;
    cursor: pointer;
    border: none;
}

.btn-reply:hover,
.btn-quote:hover,
.btn-edit:hover {
    background-color: var(--button-hover);
}

.reply-form {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-top: 20px;
}

.reply-form h2 {
    margin-top: 0;
    color: var(--accent-dark);
}

.navigation-container {
    margin-bottom: 20px;
    padding: 10px;
    background-color: var(--bg-medium);
    color: var(--text-white);
    border-radius: var(--border-radius);
}

.navigation-container a {
    color: var(--text-white);
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   ACCESSIBILITY
   ========================================= */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.ButtonBig:focus-visible,
.FrameBoxContent a:focus-visible,
.MainMenu:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (forced-colors: active) {
    :root {
        --bg-dark: Canvas;
        --bg-light: CanvasText;
        --text-link: Highlight;
    }
}

/* Print styles */
@media print {
    #Header,
    #LeftColumn,
    #RightColumn,
    .ButtonBig,
    .FrameBoxHeader,
    .FrameBoxFooter {
        display: none !important;
    }

    #PageContent {
        background: white !important;
        color: black !important;
        border: none !important;
    }

    #Footer {
        display: none !important;
    }
}