/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #141414;
    --bg-secondary: #141414;
    --bg-tertiary: #1a1a1a;
    --bg-card: #1e1e1e;
    --border-color: #2d2d2d;
    --text-primary: #e4e7eb;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    --accent-primary: #667eea;
    --accent-secondary: #764ba2;
    --success: #48bb78;
    --error: #f56565;
    --warning: #ed8936;
    --processing: #4299e1;
    --hover-bg: #252525;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #141414;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== TOP NAVIGATION ===== */
.top-nav {
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(20, 20, 20, 0.95);
}

.nav-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.nav-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-right {
    display: flex;
    gap: 12px;
}

.nav-link-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-link-btn:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.nav-link-btn i {
    font-size: 18px;
}

/* ===== MAIN WRAPPER ===== */
.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-wrapper {
    flex: 1;
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
    width: 100%;
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    align-items: start;
}

/* ===== LEFT PANEL ===== */
.left-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    height: fit-content;
    position: sticky;
    top: 88px;
}

.panel-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-header i {
    color: var(--accent-primary);
}

.panel-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.setting-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.setting-header i {
    color: var(--accent-primary);
    font-size: 14px;
}

.setting-input,
.setting-select {
    width: 100%;
    padding: 8px 12px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.setting-input:focus,
.setting-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.setting-input::placeholder {
    color: var(--text-muted);
}

.setting-select {
    cursor: pointer;
    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='%23a0aec0' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.uid-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.uid-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.uid-item label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.server-team-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.server-item,
.team-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ===== RIGHT PANEL ===== */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

/* ===== DASHBOARD CARD ===== */
.dashboard-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    position: sticky;
    top: calc(100vh - 160px);
    z-index: 49;
    flex-shrink: 0;
    margin-bottom: 12px;
}

.card-header-modern {
    padding: 16px 20px;
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left i {
    color: var(--accent-primary);
    font-size: 18px;
}

.header-left h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
}

.status-dot.processing {
    background-color: var(--processing);
}

.status-dot.error {
    background-color: var(--error);
}

.status-dot.success {
    background-color: var(--success);
}

.card-body-modern {
    padding: 20px 24px;
}

.status-display {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    min-height: 80px;
}

.status-output {
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    line-height: 1.6;
}

.status-output.success-state {
    color: var(--success);
}

.status-output.error-state {
    color: var(--error);
}

.status-output.processing-state {
    color: var(--processing);
}

/* ===== EMOTES SECTION ===== */
.emotes-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    position: sticky;
    top: 88px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 88px - 280px);
    max-height: calc(100vh - 88px - 280px);
    overflow: hidden;
    margin-bottom: 12px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.section-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-header i {
    color: var(--accent-primary);
}

.count-badge {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Emote Search Bar */
.emote-search-container {
    margin-bottom: 16px;
    flex-shrink: 0;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.emote-search-input {
    width: 100%;
    padding: 10px 40px 10px 40px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.emote-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.emote-search-input:focus ~ .search-clear-btn,
.emote-search-input:not(:placeholder-shown) ~ .search-clear-btn {
    display: flex;
}

.emote-search-input::placeholder {
    color: var(--text-muted);
}

.search-clear-btn {
    position: absolute;
    right: 8px;
    width: 28px;
    height: 28px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.search-clear-btn:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.search-clear-btn i {
    font-size: 12px;
}

.emotes-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    padding-right: 8px;
    min-height: 0;
    max-height: calc(100vh - 500px);
}

.emotes-grid-modern::-webkit-scrollbar {
    width: 8px;
}

.emotes-grid-modern::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.emotes-grid-modern::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.emotes-grid-modern::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

.emote-tile {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.emote-tile[style*="display: none"] {
    display: none !important;
}

.emote-tile:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.tile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.emote-icon-wrapper {
    width: 70px;
    height: 70px;
    background-color: var(--bg-secondary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.emote-icon {
    width: 90%;
    height: 90%;
    object-fit: contain;
}

.action-btn {
    width: 100%;
    padding: 8px 12px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tile-body {
    text-align: center;
}

.emote-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.3;
}

.emote-meta {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.meta-tag {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.meta-tag i {
    font-size: 10px;
}

/* ===== COMMAND BUTTONS ===== */
.command-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-top: 8px;
}

.command-btn {
    padding: 8px 10px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.command-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.command-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.command-btn i {
    font-size: 12px;
}

.command-item {
    margin-bottom: 8px;
}

.macro-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)) !important;
}

.macro-btn:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .main-wrapper {
        grid-template-columns: 320px 1fr;
    }
    
    .emotes-grid-modern {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 968px) {
    .main-wrapper {
        grid-template-columns: 1fr;
    }
    
    .left-panel {
        position: relative;
        top: 0;
    }
    
    .dashboard-card {
        position: relative;
        top: 0;
        margin-bottom: 24px;
    }
    
    .emotes-container {
        position: relative;
        top: 0;
        height: auto;
        max-height: none;
    }
    
    .uid-row {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-content {
        padding: 0 16px;
    }
    
    .nav-title {
        font-size: 16px;
    }
    
    .main-wrapper {
        padding: 16px;
    }
    
    .dashboard-card {
        position: relative;
        top: 0;
        margin-bottom: 24px;
    }
    
    .emotes-container {
        position: relative;
        top: 0;
        height: auto;
        max-height: none;
    }
    
    .emotes-grid-modern {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    
    .uid-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .emote-icon-wrapper {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .emotes-grid-modern {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .uid-row {
        grid-template-columns: repeat(2, 1fr);
    }
}
