:root {
    --mc-green: #4CAF50;
    --mc-dark-green: #2E7D32;
    --mc-red: #F44336;
    --mc-yellow: #FFC107;
    --mc-dark: #212121;
    --mc-light: #f5f5f5;
    --mc-gray: #757575;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--mc-light);
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: #1a3a1a;
    background-image: url(../../img/2.avif);
    background-size: cover;
    background-position: center center;
    color: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
}

header.has-link {
    cursor: pointer;
}

header.has-link .ip-search-container {
    cursor: default;
}

.header-nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.8rem;
    flex-wrap: wrap;
}

.header-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.4rem 1.1rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50px;
    color: rgba(255,255,255,0.7);
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    position: relative;
    z-index: 2;
}

.header-nav-item.active {
    background: rgba(255,255,255,0.3);
    color: #fff;
    border-color: rgba(255,255,255,0.4);
    font-weight: 600;
}

.header-nav-item:hover:not(.active) {
    background: rgba(255,255,255,0.2);
    color: white;
}

.ip-search-container {
    margin: 1.5rem auto;
    max-width: 600px;
    background: rgba(255,255,255,0.1);
    padding: 1rem;
    border-radius: 10px;
}

.ip-search-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ip-search-input {
    flex: 1;
    min-width: 0;
    padding: 0.8rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
}

.ip-search-btn {
    background: var(--mc-yellow);
    color: var(--mc-dark);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
    white-space: nowrap;
}

.ip-search-btn:hover {
    background: #FFD54F;
}

.update-info {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    margin-top: 1rem;
    font-size: 0.9rem;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
}

.search-result {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255,255,255,0.9);
    border-radius: 8px;
    color: #333;
    display: none;
}

.search-result.error {
    background: rgba(255,235,235,0.9);
    color: var(--mc-red);
}

.server-logo {
    max-width: 64px;
    max-height: 64px;
    margin-right: 1rem;
    border-radius: 5px;
}

.server-info-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.server-motd {
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
}

.server-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-item {
    text-align: center;
    padding: 0.5rem;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 5px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--mc-green);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--mc-gray);
}

.rating-container {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}

.history-section {
    margin: 0.8rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-container {
    position: relative;
    width: 100%;
    margin-top: 1rem;
}

.history-section h4 {
    margin-bottom: 1rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.embed-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
    text-align: center;
}

.embed-section h4 {
    color: var(--mc-dark-green);
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.embed-section > p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.embed-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.embed-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: rgba(76, 175, 80, 0.08);
    border: 1px solid rgba(76, 175, 80, 0.2);
    border-radius: 50px;
    color: var(--mc-gray);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.embed-tab.active {
    background: var(--mc-green);
    color: white;
    border-color: var(--mc-green);
}

.embed-tab:hover:not(.active) {
    background: rgba(76, 175, 80, 0.15);
    color: var(--mc-dark-green);
}

.embed-panels {
    text-align: left;
}

.embed-panel {
    display: none;
}

.embed-panel.active {
    display: block;
    overflow: visible;
}

.embed-desc {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.embed-code-wrapper {
    position: relative;
    overflow: visible;
}

.embed-code-box {
    position: relative;
    padding: 1rem;
    padding-right: 5rem;
    background: #f5f5f5;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    text-align: left;
    border: 1px solid rgba(0, 0, 0, 0.05);
    word-wrap: break-word;
    white-space: pre-wrap;
    height: 90px;
    overflow: hidden;
}

.embed-copy-btn {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    background: var(--mc-green);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s;
}

.embed-copy-btn:hover {
    background: var(--mc-dark-green);
}

.embed-copy-btn.copied {
    background: #66bb6a;
}

.embed-help-icon {
    position: absolute;
    top: -24px;
    right: 0;
    color: #666;
    cursor: help;
    z-index: 3;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.embed-help-icon:hover {
    color: var(--mc-green);
}

.embed-help-icon:hover .embed-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.embed-tooltip {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    width: 220px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.5;
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    text-align: left;
}

.embed-tooltip a {
    color: white;
}

.embed-tooltip:after {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 10px;
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent rgba(0, 0, 0, 0.85) transparent;
}

.embed-tooltip i {
    color: var(--mc-green);
    margin-right: 5px;
}

footer {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    padding: 2rem;
    margin-top: 3rem;
    text-align: center;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
    color: #555;
    font-size: 0.95rem;
}

.footer-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.footer-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.7);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--mc-dark-green);
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-link:hover {
    color: var(--mc-green);
    transform: translateY(-1px);
}

.copyright {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--mc-gray);
}

button, .back-to-top {
    -webkit-tap-highlight-color: transparent;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 0;
    width: 50px;
    height: 50px;
    background: var(--mc-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--mc-dark-green);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 1000;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    pointer-events: none;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

.toast.success {
    background: linear-gradient(135deg, var(--mc-green), var(--mc-dark-green));
}

.toast.error {
    background: linear-gradient(135deg, var(--mc-red), #c62828);
}

.toast i {
    font-size: 1.1rem;
}

.empty-state {
    grid-column: 1/-1;
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: linear-gradient(145deg, #fafbfc, #f0f2f5);
    border-radius: 12px;
    border: 1px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

.empty-state i {
    font-size: 2.5rem;
    color: var(--mc-green);
    margin-bottom: 1rem;
    display: inline-block;
    padding: 1rem;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-radius: 50%;
}

.empty-state p {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.8;
    margin: 0;
}

.empty-state p a {
    color: var(--mc-green);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dashed var(--mc-green);
}

.empty-state p a:hover {
    color: var(--mc-dark-green);
    border-bottom-color: var(--mc-dark-green);
}

@media (max-width: 768px) {
    .ip-search-form {
        flex-direction: column;
        gap: 0.5rem 0;
    }
    
    .ip-search-btn {
        width: 100%;
        padding: 0.8rem;
    }

    .embed-section {
        padding: 1rem 0.5rem;
    }

    .embed-code-box {
        font-size: 0.85rem;
        padding: 0.8rem;
    }

    .footer-stats {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }

    .footer-links {
        align-items: center;
        flex-direction: column;
        gap: 0.8rem;
    }

    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
}
