/* ===== GLOBAL STYLES & UI REFRESH WITH ADVANCED IMAGE OPTIMIZATION ===== */
/* Specialized Image Caching & Loading */
.lazy-emote-image {
    opacity: 0;
    transition: opacity 0.3s ease;
    will-change: opacity;
    transform: translateZ(0); /* Hardware acceleration */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.lazy-emote-image.loaded {
    opacity: 1;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f9;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 30px 0;
    background: linear-gradient(90deg, #4f46e5, #8b5cf6, #ec4899, #f43f5e, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 300% 300%;
    animation: gradient 8s ease infinite, float 6s ease-in-out infinite;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #4f46e5, #8b5cf6, #ec4899, #f43f5e, #f59e0b);
    background-size: 300% 300%;
    animation: gradient 8s ease infinite;
    border-radius: 3px;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
}

/* ===== SOCIAL LINKS STYLES ===== */
.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.social-button {
    text-decoration: none;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95em;
}

.social-button i {
    margin-right: 8px;
}

.social-button.discord { 
    background-color: #5865F2; 
}

.social-button.telegram { 
    background-color: #0088cc; 
}

.social-button.youtube { 
    background-color: #FF0000; 
}

.social-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.social-button.discord:hover { 
    background-color: #4752C4; 
}

.social-button.telegram:hover { 
    background-color: #0077b5; 
}

.social-button.youtube:hover { 
    background-color: #CC0000; 
}

/* ===== POPUP MODAL STYLES ===== */
#welcome-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

#welcome-modal {
    background: white;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 500px;
    width: 90%;
}

#welcome-modal h2 {
    margin-top: 0;
    color: #2c3e50;
}

#welcome-modal p {
    color: #555;
    margin-bottom: 25px;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.modal-button {
    text-decoration: none;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-button i {
    margin-right: 10px;
}

.modal-button.discord { background-color: #5865F2; }
.modal-button.telegram { background-color: #0088cc; }
.modal-button.youtube { background-color: #FF0000; }

.modal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#close-modal-btn {
    padding: 10px 25px;
    border: none;
    background-color: #27ae60;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.2s;
}

#close-modal-btn:hover {
    background-color: #229954;
}

/* ===== PASSWORD INPUT STYLES ===== */
.password-inputs {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.password-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.password-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95em;
    text-align: left;
}

.password-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.password-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.2s;
    outline: none;
}

.password-input:focus {
    border-color: #4f46e5;
}

.get-password-btn {
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    color: white;
    font-weight: bold;
    font-size: 0.9em;
    white-space: nowrap;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.get-password-btn.youtube {
    background-color: #FF0000;
}

.get-password-btn.youtube:hover {
    background-color: #CC0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 0, 0, 0.3);
}

.get-password-btn.telegram {
    background-color: #0088cc;
}

.get-password-btn.telegram:hover {
    background-color: #0077b5;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 136, 204, 0.3);
}

/* ===== IMPROVED INPUT SECTION ===== */
.input-section {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.input-group label i {
    margin-right: 8px;
    color: #007bff;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.server-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    background-color: white;
    font-size: 1em;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    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='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.server-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.server-select:hover {
    border-color: #007bff;
}

.uid-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* ===== RESULT DISPLAY ===== */
.result-display {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.result-display h3 {
    margin-top: 0;
    color: #333;
}

.api-url-box {
    background-color: #2d3748; /* Dark background for code */
    color: #e2e8f0; /* Light text */
    padding: 15px;
    border: 1px solid #4a5568;
    border-radius: 6px;
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    word-break: break-all;
    white-space: pre-wrap;
    min-height: 50px;
}

/* ===== REDESIGNED EMOTE LIST ===== */
.emote-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); 
    gap: 20px;
}

.emote-item {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.emote-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.emote-item img {
    width: 80px;
    height: 80px;
    object-fit: contain; /* Use contain to avoid cropping emotes */
    margin-bottom: 12px;
}

.emote-details {
    margin-bottom: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.emote-name {
    font-weight: 600;
    font-size: 0.95em;
    margin: 5px 0;
    color: #2c3e50;
}

.emote-id {
    color: #7f8c8d;
    margin: 0;
    font-size: 0.8em;
}

.send-button {
    padding: 10px 15px;
    background-color: #569eeb;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    transition: background-color 0.2s, transform 0.1s;
}

.send-button:hover {
    background-color: #0056b3;
}

.send-button:active {
    transform: scale(0.98);
}

.send-button:disabled {
    background-color: #aaa;
    cursor: not-allowed;
}


/* ================================================= */
/* ===== VERTICAL LIGHT THEME DASHBOARD (FIXED) ===== */
/* ================================================= */

.monitoring-dashboard {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 0;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
    color: #333;
    overflow: hidden;
}

/* Header/Button Styling */
.dashboard-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

.dashboard-header-container:hover {
    background-color: #f7f7f7;
}

.monitoring-dashboard h2 {
    color: #007BFF;
    margin: 0; 
    font-size: 1em;
    font-weight: 600;
    text-shadow: none;
}

/* Icon for +/- */
.toggle-icon {
    color: #888;
    font-size: 1em;
    transition: color 0.2s, transform 0.3s;
}

.dashboard-header-container:hover .toggle-icon {
    color: #007BFF;
}

/* Content Area */
.dashboard-content {
    padding: 15px;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    max-height: 500px;
    opacity: 1;
}

/* Minimize State */
.monitoring-dashboard.minimized .dashboard-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    pointer-events: none;
}
.monitoring-dashboard.minimized .dashboard-header-container {
    border-bottom: none;
}
.monitoring-dashboard.minimized .toggle-icon {
    transform: rotate(-90deg);
}

/* Metric Grid (Vertical Stack) */
.monitoring-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.metric-card {
    background-color: #f7f9fc;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    border: 1px solid #e9edf1;
}

.metric-title {
    font-size: 0.75em;
    font-weight: 500;
    margin-bottom: 5px;
    color: #555;
}

.metric-value {
    font-size: 1.6em;
    font-weight: 700;
    color: #007BFF;
}

/* Status text at the bottom */
.last-updated {
    font-size: 0.75em;
    color: #999;
    text-align: center;
    margin-top: 15px;
}

.last-updated.error {
    color: #d9534f;
    font-weight: bold;
}


/* ===== BLINKING RED EFFECT ===== */
@keyframes blink-red {
    0% { color: inherit; }
    50% { color: red; }
    100% { color: inherit; }
}

.blink-red {
    animation: blink-red 1s infinite;
}

/* ===== MOBILE RESPONSIVE STYLES (Max Width 768px) ===== */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    /* Emote List compactness */
    .emote-list {
        grid-template-columns: repeat(3, 1fr); 
        gap: 10px;
    }

    .emote-item {
        padding: 10px 5px; 
    }
    
    .emote-item img {
        width: 50px; 
        height: 50px;
    }
    
    .emote-name {
        font-size: 11px;
    }
    
    .emote-id {
        font-size: 9px;
    }
    
    .send-button {
        padding: 6px 5px;
        font-size: 11px;
    }
}