@import "tipsy.css";

/* ==========================================================================
   1. GLOBAL & BACKGROUND SETTINGS
   ========================================================================== */
body {
    background-color: #000000; /* Black fallback */
    background-image: url('../images/bg-infinityv2.webp');
    background-repeat: no-repeat;
    background-position: center top; /* Centers the image */
    background-size: cover;          /* SCALES image to fit any screen size */
    background-attachment: fixed;    /* Keeps background locked while scrolling */
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    font-family: Verdana, Helvetica, sans-serif;
}

td { 
    color: #999; 
    font-size: 13px;
}

a {
    text-decoration: none;
    color: #fff;
    font: bold 12px/18px Arial, sans-serif;
    text-transform: uppercase;
    text-shadow: #000 0 0 6px;
    padding: 10px;
}

/* ==========================================================================
   2. FORMS & BUTTONS
   ========================================================================== */
fieldset {
    border: 1px solid #777; 
    margin-bottom: 3px; 
    padding: 0 0 5px 5px;
    background-color: #000;
}

legend {
    color: #e19100;
    font: bold 12px/18px Arial, sans-serif;
    background-color: #000;
}

form input, form select {
    background: #0A0809;
    border: 1px solid #1E1E1E;
    padding: 2px;
    float: left;
    margin: 7px 5px 4px 0;
    border-radius: 3px;
    color: #fff;
    font-family: tahoma;
}

form input:focus {
    outline: none;
    border-color: #e19100;
}

form input.buttons {
    background: #000;
    border: 1px solid #d14040;
    cursor: pointer;
    font-size: 14px;
    width: 142px;
    padding: 2px 15px;
}

form input.buttons:hover {
    background: #58261a;
}

/* ==========================================================================
   3. LEGACY SIDEBAR & MENU STYLES
   ========================================================================== */
.dmn {
    background-image: url(../images/c.png);
    background-repeat: no-repeat;
    background-position: top;
}

.button {
    background-image: url(../images/name_link.png);
    width: 226px;
    height: 39px;
    margin: 2px;
}

.menu {
    text-decoration: none;
    letter-spacing: -.4px;
    color: #fff;
    float: left;
    font: bold 12px/18px Arial, sans-serif;
    text-transform: uppercase;
    cursor: pointer;
    text-shadow: #000 0 1px 1px;
    padding: 10px;
}

.menu:hover {
    color: #d14040;
}

.shdowrd111 {
    box-shadow: 0 0 5px #000;
    border-radius: 3px;
}

/* ==========================================================================
   4. MODERN VOTE MODULE (LAYOUT)
   ========================================================================== */
.vote-module {
    width: 536px;
    margin: 0 auto;
    font-family: Arial, sans-serif;
    color: #999;
    position: relative;
}

/* Header */
.vote-header {
    height: 75px;
    background: url('../images/details.png') no-repeat top center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

.vote-user-info { font-size: 14px; }
.vote-credits-info { font-size: 13px; color: #ccc; }
.highlight { color: #fff; font-weight: bold; }
.gold-text { color: #FFD700; font-weight: bold; }

/* Body */
.vote-body {
    background: url('../images/vote_c.png') repeat-y top center;
    width: 536px;
    padding: 0 20px 20px 20px;
    box-sizing: border-box;
    text-align: center;
    /* This negative margin closes the gap between header and body */
    margin-top: -10px; 
    position: relative;
    z-index: 1; 
}
.vote-login {
    background: url('../images/vote_c.png') repeat-y top center;
    width: 536px;
    padding: 0 20px 20px 20px;
    box-sizing: border-box;
    text-align: center;
    /* This negative margin closes the gap between header and body */
    margin-top: -15px; 
    position: relative;
    z-index: 1; 
}

/* Info Box */
.vote-info-box {
    border: 1px solid #444;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: left;
    background: rgba(0, 0, 0, 0.3);
    position: relative;
    margin-top: 10px;
}

.vote-login-box {
    border: 1px solid #444;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: left;
    background: rgba(0, 0, 0, 0.3);
    position: relative;
    margin-top: -20px;
}

.vote-body .vote-info-box:last-child {
    margin-bottom: 0;
}

.info-legend {
    color: #FFD700;
    font-weight: bold;
    position: absolute;
    top: -10px;
    left: 10px;
    background: #000; 
    padding: 0 5px;
    font-size: 12px;
}

.info-content ul {
    margin: 5px 0 0 0;
    padding-left: 20px;
    font-size: 11px;
    color: #ccc;
    line-height: 1.5;
}

/* Footer */
.vote-footer {
    height: 35px;
    background: url('../images/vote_b.png') no-repeat top center;
    display: block;
    clear: both;
}

.login-footer {
    height: 35px;
    background: url('../images/vote_b.png') no-repeat top center;
    display: block;
    clear: both;
    margin-top: -20px;
}

/* ==========================================================================
   5. VOTING LINKS & BANNERS
   ========================================================================== */
.vote-links-box {
    border: 1px solid #444;
    border-radius: 5px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    overflow: hidden; 
    height: auto;
}

.vote-links-title {
    color: #fff;
    margin-bottom: 10px;
    font-weight: bold;
    display: block;
    width: 100%;
}

.vote-banners-wrapper {
    display: block;
    text-align: center;
    width: 100%;
}

.vote-banner-item {
    display: inline-block;
    margin: 4px;
    vertical-align: middle;
}

.vote-banner-item img {
    max-width: 100%;
    height: auto;
    border-radius: 3px;
    float: none !important; 
    transition: transform 0.2s;
}

.vote-banner-item img:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

/* Javascript Targets */
#vote_error {
    margin: 10px 0;
    color: #ff0000;
    font-weight: bold;
    text-align: center;
    word-wrap: break-word; 
    max-width: 100%;       
}

#vote_counter {
    display: none;
    text-align: center;
    padding: 20px 0;
    color: #fff;
    font-weight: bold;
}

/* ==========================================================================
   6. RANKING TABLE STYLES
   ========================================================================== */
.ranking-table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-table th {
    background: rgba(0, 0, 0, 0.9);
    color: #FFD700;
    font-weight: bold;
    padding: 12px 5px;
    font-size: 11px;
    text-transform: uppercase;
    border-bottom: 2px solid #555;
    letter-spacing: 1px;
}

.ranking-table td {
    padding: 8px 5px;
    border-bottom: 1px solid #333;
    font-size: 13px;
    color: #ccc;
    background: rgba(0, 0, 0, 0.2);
}

.ranking-table tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

/* Column Widths */
.col-rank { width: 50px; text-align: center; }
.col-char { text-align: left; padding-left: 20px; }
.col-votes { width: 100px; text-align: center; }
.col-date { width: 140px; text-align: center; }

/* Rank Badges */
.rank-badge {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #222;
    color: #888;
    font-size: 11px;
    font-weight: bold;
    border: 1px solid #444;
}

/* Top 3 Highlighting */
.rank-row.rank-1 .rank-badge { 
    background: #FFD700; color: #000; 
    border-color: #e5c100;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.4); 
}
.rank-row.rank-2 .rank-badge { 
    background: #C0C0C0; color: #000; border-color: #aaaaaa;
}
.rank-row.rank-3 .rank-badge { 
    background: #CD7F32; color: #000; border-color: #b87333;
}

.rank-row.rank-1 .char-name { color: #FFD700; font-weight: bold; text-shadow: 0 0 5px rgba(255, 215, 0, 0.2); }
.rank-row.rank-2 .char-name { color: #fff; font-weight: bold; }
.rank-row.rank-3 .char-name { color: #ddd; font-weight: bold; }

/* Buttons & Links */
.view-details-btn {
    background: #111;
    border: 1px solid #444;
    color: #FFD700;
    padding: 8px 15px;
    text-decoration: none;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: bold;
    border-radius: 3px;
    display: inline-block;
    margin: 10px 0;
    transition: all 0.3s ease;
}

.view-details-btn:hover {
    background: #222;
    border-color: #FFD700;
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

/* ==========================================================================
   7. MODERN LOGIN FORM
   ========================================================================== */
.login-form-modern {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.form-group label {
    color: #FFD700;
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    background: #111;
    border: 1px solid #444;
    color: #fff;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    border-color: #FFD700;
}

.login-btn {
    background: linear-gradient(to bottom, #444, #222);
    border: 1px solid #555;
    color: #fff;
    font-weight: bold;
    padding: 10px;
    cursor: pointer;
    border-radius: 4px;
    text-transform: uppercase;
    width: 100%;
    transition: all 0.2s;
}

.login-btn:hover {
    background: linear-gradient(to bottom, #555, #333);
    border-color: #FFD700;
    color: #FFD700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

/* ==========================================================================
   8. SIDEBAR STYLES
   ========================================================================== */
.sidebar-container {
    width: 234px;
    margin: 0; padding: 0;
    display: flex; flex-direction: column;
}
.sidebar-cap { display: block; width: 100%; }
.sidebar-body { background: url('../images/v.png') repeat-y top center; width: 234px; }
.sidebar-inner {
    background: url('../images/c.png') no-repeat top center;
    min-height: 327px;
    padding: 20px 25px;
    box-sizing: border-box;
    display: flex; flex-direction: column;
}
.sidebar-nav { display: flex; flex-direction: column; height: 100%; min-height: 280px; }
.nav-btn {
    display: block; text-decoration: none; color: #aaa;
    font-family: Arial, sans-serif; font-size: 13px; font-weight: bold;
    text-transform: uppercase; text-align: center;
    padding: 10px 0; margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.4); border: 1px solid #333; border-radius: 4px;
    transition: all 0.2s ease-in-out;
}
.nav-btn:hover, .nav-btn.active {
    color: #fff; background: rgba(50, 50, 50, 0.6);
    border-color: #777; box-shadow: 0 0 10px rgba(255, 215, 0, 0.2); text-shadow: 0 0 5px #fff;
}
.admin-btn { color: #FFD700; border-color: #665500; }
.logout-btn { margin-top: auto; background: rgba(100, 0, 0, 0.3); border-color: #500; }
.logout-btn:hover { background: rgba(180, 0, 0, 0.5); border-color: #f00; box-shadow: 0 0 10px rgba(255, 0, 0, 0.3); }
.logout-spacer { flex-grow: 1; }

/* ==========================================================================
   9. TIPSY TOOLTIPS
   ========================================================================== */
.tipsy { font-size: 13px; position: absolute; padding: 5px; z-index: 100000; }
.tipsy-inner {
    background-color: rgba(0, 0, 0, 0.95);
    color: #ddd; max-width: 250px; padding: 10px 15px; text-align: center;
    border: 1px solid #FFD700; border-radius: 4px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
    font-family: Arial, sans-serif; line-height: 1.5; text-shadow: none;
}
.tipsy-arrow-n { border-bottom-color: #FFD700; }
.tipsy-arrow-s { border-top-color: #FFD700; }
.tipsy-arrow-e { border-left-color: #FFD700; }
.tipsy-arrow-w { border-right-color: #FFD700; }

/* ==========================================================================
   10. ALERTS (Legacy)
   ========================================================================== */
.alert {
    overflow: hidden; position: relative; border: 1px solid #000; border-radius: 4px;
    padding: 7px 10px; font: bold 12px/18px Arial, sans-serif; margin-bottom: 5px;
}
.alert.error { background-color: #c43c35; color: #fff; }
.alert.success { background-color: #57a957; color: #fff; }
.alert ul { list-style: none; margin: 0; }
.alert li { line-height: 20px; }

.clearfix::after { content: ""; clear: both; display: table; }

/* ==========================================================================
   12. LOGIN FORM BUG FIXES (OVERRIDE LEGACY FLOATS)
   ========================================================================== */

/* 1. Reset the "float" so elements stack vertically */
.vote-info-box form label,
.vote-info-box form input[type="text"],
.vote-info-box form input[type="password"],
.vote-info-box form .buttons {
    float: none !important; 
    display: block !important; 
}

/* 2. Style the Labels (Username/Password) */
.vote-info-box form label {
    width: 100% !important;
    text-align: left;
    margin: 0 0 5px 0 !important; /* Space below label */
    padding: 0 !important;
    color: #FFD700; /* Gold */
    font-weight: bold;
    text-transform: uppercase;
    font-size: 12px;
}

/* 3. Style the Inputs */
.vote-info-box form input[type="text"], 
.vote-info-box form input[type="password"] {
    width: 100% !important;       /* Force full width */
    box-sizing: border-box;       /* Keeps padding inside the width */
    background: #111 !important;  /* Dark background */
    border: 1px solid #444 !important;
    color: #fff !important;
    padding: 10px !important;     /* Bigger click area */
    margin: 0 0 15px 0 !important; /* Space between fields */
    border-radius: 3px;
    height: auto !important;      /* Fix for legacy height issues */
}

/* 4. Input Focus Effect */
.vote-info-box form input[type="text"]:focus, 
.vote-info-box form input[type="password"]:focus {
    border-color: #FFD700 !important;
    outline: none;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

/* 5. Style the Login Button */
.vote-info-box form input.buttons {
    width: 100% !important;
    margin: 10px 0 0 0 !important;
    height: 40px !important;
    background: #000;
    border: 1px solid #d14040; /* Red border from your screenshot */
    color: #fff;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.vote-info-box form input.buttons:hover {
    background: #d14040;
    color: #fff;
    box-shadow: 0 0 10px rgba(209, 64, 64, 0.4);
}

/* ==========================================================================
   13. ALERT BOX FIXES (Make them flexible and clean)
   ========================================================================== */

/* 1. Reset the Alert Container */
.vote-module .alert {
    float: none !important;
    width: auto !important;
    height: auto !important; /* Allow it to grow with text */
    overflow: visible !important; /* Stop cutting off text */
    display: block;
    margin-bottom: 15px;
    box-sizing: border-box;
    
    /* Modern Styling */
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    text-align: center; /* Center the error message */
}

/* 2. Fix the List inside the Alert (Remove dots/squares) */
.vote-module .alert ul {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important; /* No bullet points */
}

.vote-module .alert li {
    margin: 0;
    padding: 5px 0;
    font-size: 13px;
    font-weight: bold;
    color: #fff; /* Ensure text is readable */
    line-height: 1.4;
}

/* 3. Specific Colors (Just in case they are missing) */
.vote-module .alert.error {
    background: #c43c35;
    border: 1px solid #801515;
}

.vote-module .alert.success {
    background: #57a957;
    border: 1px solid #307530;
}

/* --- Floating Credit Animation --- */
#credit-floater {
    position: absolute;
    top: 5px;          /* Start position (near the number) */
    right: -10px;       /* Align to right */
    font-size: 14px;
    font-weight: bold;
    color: #00ff00;     /* Green text */
    text-shadow: 1px 1px 1px #000;
    pointer-events: none; /* Let clicks pass through */
    opacity: 0;         /* Hidden by default */
    z-index: 100;
}

/* The Animation Keyframes */
@keyframes floatUpFade {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-15px) scale(1.2); /* Move up and grow slightly */
        opacity: 1;
    }
    100% {
        transform: translateY(-30px) scale(1);   /* Move further up */
        opacity: 0; /* Fade out completely */
    }
}

/* Class to trigger the animation */
.float-animation {
    animation: floatUpFade 2s ease-out forwards;
}