/* PLIVE - Gaming Theme CSS */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: rgba(26, 26, 37, 0.8);
    --neon-cyan: #00f5ff;
    --neon-magenta: #ff00ff;
    --neon-purple: #9d4edd;
    --neon-green: #00ff88;
    --neon-orange: #ff6b35;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-neon: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(0, 245, 255, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-glow-cyan: 0 0 20px rgba(0, 245, 255, 0.3);
    --header-height: 60px;
    --font-primary: 'Inter', sans-serif;
    --font-display: 'Orbitron', sans-serif;
    --transition-normal: 0.3s ease;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 20% 20%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(118, 75, 162, 0.15) 0%, transparent 50%);
    z-index: -1;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    font-weight: 700;
}

a {
    color: var(--neon-cyan);
    text-decoration: none;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-neon);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    animation: logoGlow 2s ease-in-out infinite;
}

@keyframes logoGlow {

    0%,
    100% {
        box-shadow: 0 0 10px var(--neon-cyan);
    }

    50% {
        box-shadow: 0 0 20px var(--neon-magenta);
    }
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    background: var(--gradient-neon);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 12px;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-normal);
}

.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow-cyan);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 0.85rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff4444;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: var(--neon-green);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.lang-select {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

/* Main Content */
.main-content {
    margin-top: var(--header-height);
    padding: 1.5rem;
    min-height: calc(100vh - var(--header-height));
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    transition: var(--transition-normal);
}

.card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow-cyan);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title i {
    color: var(--neon-cyan);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-normal);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-cyan);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--neon-cyan);
}

.btn-success {
    background: linear-gradient(135deg, #00c853, #00e676);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ff1744, #ff5252);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Inputs */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition-normal);
    outline: none;
}

.form-input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 3px rgba(0, 245, 255, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

.input-group .form-input {
    flex: 1;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--neon-cyan);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-neon);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.activity-log {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.gift {
    background: linear-gradient(135deg, #ff6b35, #ff8c00);
}

.activity-icon.chat {
    background: linear-gradient(135deg, #00bcd4, #00e5ff);
}

.activity-icon.like {
    background: linear-gradient(135deg, #e91e63, #ff4081);
}

.activity-icon.follow {
    background: linear-gradient(135deg, #9c27b0, #ba68c8);
}

.activity-icon.share {
    background: linear-gradient(135deg, #4caf50, #8bc34a);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-user {
    font-weight: 600;
    color: var(--neon-cyan);
}

.activity-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    word-break: break-word;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Triggers */
.triggers-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
}

.trigger-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    transition: var(--transition-normal);
}

.trigger-card:hover {
    border-color: var(--neon-magenta);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.3);
}

.trigger-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.trigger-name {
    font-weight: 600;
    font-size: 1rem;
}

.trigger-actions {
    display: flex;
    gap: 0.25rem;
}

.trigger-content {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.trigger-gift-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--neon-cyan);
    font-size: 1.5rem;
}

.trigger-gift-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.trigger-details {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.trigger-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.trigger-detail i {
    width: 16px;
    color: var(--neon-cyan);
}

/* Picker Button */
.picker-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-normal);
}

.picker-btn:hover {
    border-color: var(--neon-cyan);
    background: var(--bg-tertiary);
}

.picker-btn.has-selection {
    border-color: var(--neon-cyan);
    background: rgba(0, 245, 255, 0.05);
}

.picker-btn span {
    flex: 1;
    text-align: left;
}

.picker-btn i:first-child {
    color: var(--neon-cyan);
}

.picker-btn i:last-child {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Picker Popup */
.form-group {
    position: relative;
}

.picker-popup {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    z-index: 100;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-height: 350px;
    overflow-y: auto;
}

.picker-popup.active {
    display: block;
}

.picker-popup .form-input {
    margin-bottom: 0.75rem;
}

/* Gift picker uses grid */
.picker-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

/* Music picker uses grid with wider items */
#musicList.picker-list {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.music-suggestions-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.music-suggestion-mini-btn {
    padding: 0.4rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-normal);
}

.music-suggestion-mini-btn:hover {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

/* Gift Grid */
.gift-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.gift-item {
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-normal);
}

.gift-item:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
}

.gift-item.selected {
    border-color: var(--neon-cyan);
    background: rgba(0, 245, 255, 0.1);
}

.gift-item img {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.5rem;
    object-fit: contain;
    display: block;
}

.gift-item-name {
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gift-item-price {
    font-size: 0.7rem;
    color: var(--neon-orange);
    font-weight: 600;
}

.gift-img {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.5rem;
    object-fit: contain;
}

.gift-name {
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gift-coins {
    font-size: 0.7rem;
    color: var(--neon-orange);
    font-weight: 600;
}

/* Music */
.music-list {
    max-height: 300px;
    overflow-y: auto;
}

.music-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    background: linear-gradient(135deg, rgba(30, 30, 40, 0.8), rgba(20, 20, 30, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
    min-height: 90px;
}

.music-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.05), rgba(0, 245, 255, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.music-item:hover {
    background: linear-gradient(135deg, rgba(40, 40, 55, 0.9), rgba(30, 30, 45, 0.95));
    border-color: rgba(0, 245, 255, 0.3);
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.music-item:hover::before {
    opacity: 1;
}

.music-item.selected {
    border-color: var(--neon-magenta);
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.15), rgba(255, 0, 255, 0.08));
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.2);
}

.music-item.selected::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--neon-magenta);
    border-radius: 0 3px 3px 0;
}

.music-play-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f5ff, #00bcd4);
    border: none;
    color: #0a0a0a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 245, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.music-play-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #ff00ff, #ff6b35);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.music-play-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 25px rgba(0, 245, 255, 0.5);
}

.music-play-btn:hover::before {
    opacity: 1;
}

.music-play-btn i {
    position: relative;
    z-index: 1;
}

.music-play-btn:active {
    transform: scale(0.95);
}

.music-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    position: relative;
    z-index: 1;
    line-height: 1.3;
    max-width: 100%;
    word-break: break-word;
}

.music-item:hover .music-name {
    color: var(--neon-cyan);
}

.music-check {
    color: var(--neon-magenta);
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 1rem;
    position: relative;
    z-index: 1;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

.music-item.selected .music-check {
    opacity: 1;
    animation: checkPop 0.3s ease;
}

@keyframes checkPop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

/* Music Suggestions */
.music-suggestions {
    padding: 0.5rem;
}

.music-suggestion-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.music-suggestion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
}

.music-suggestion-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 0.5rem;
    background: linear-gradient(135deg, rgba(30, 30, 45, 0.9), rgba(20, 20, 35, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    gap: 0.4rem;
    position: relative;
    overflow: hidden;
}

.music-suggestion-btn::before {
    content: '🎵';
    font-size: 1.2rem;
    display: block;
}

.music-suggestion-btn:nth-child(2)::before {
    content: '🎻';
}

.music-suggestion-btn:nth-child(3)::before {
    content: '📯';
}

.music-suggestion-btn:nth-child(4)::before {
    content: '😲';
}

.music-suggestion-btn:nth-child(5)::before {
    content: '💥';
}

.music-suggestion-btn:nth-child(6)::before {
    content: '❌';
}

.music-suggestion-btn:nth-child(7)::before {
    content: '🏆';
}

.music-suggestion-btn:nth-child(8)::before {
    content: '😂';
}

.music-suggestion-btn:hover {
    background: linear-gradient(135deg, rgba(0, 245, 255, 0.2), rgba(255, 0, 255, 0.15));
    border-color: var(--neon-cyan);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 245, 255, 0.2);
}

.music-suggestion-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Mini suggestions in popup */
.music-suggestions-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.music-suggestion-mini-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    background: linear-gradient(135deg, rgba(30, 30, 45, 0.8), rgba(25, 25, 40, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.music-suggestion-mini-btn::before {
    content: '🎵';
    font-size: 0.85rem;
}

.music-suggestion-mini-btn:hover {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
    color: #0a0a0a;
    border-color: transparent;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 245, 255, 0.3);
}

/* Overlays */
.overlays-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.overlay-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition-normal);
}

.overlay-card:hover {
    border-color: var(--neon-purple);
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.3);
}

.overlay-preview {
    height: 140px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 2rem;
}

.overlay-info {
    padding: 1rem;
}

.overlay-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.overlay-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.overlay-link input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    outline: none;
}

.overlay-actions {
    display: flex;
    gap: 0.5rem;
}

/* Countdown */
.countdown-display {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 900;
    text-align: center;
    padding: 2rem;
    background: var(--gradient-neon);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.countdown-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

/* TTS */
.tts-panel {
    max-width: 600px;
}

.speed-slider {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.speed-slider input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.speed-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--gradient-primary);
    border-radius: 50%;
    cursor: pointer;
}

.speed-value {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.connection-type-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.connection-type-tab {
    flex: 1;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
}

.connection-type-tab.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

.test-result {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    display: none;
}

.test-result.success {
    display: block;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
}

.test-result.error {
    display: block;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid #ff4444;
    color: #ff4444;
}

/* Template Selector */
.template-select {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.template-btn {
    padding: 0.6rem 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition-normal);
}

.template-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--neon-cyan);
    color: var(--text-primary);
}

.template-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

/* Preview Panel */
.preview-panel {
    position: sticky;
    top: 1rem;
}

.preview-panel h4 {
    margin-bottom: 1rem;
    color: var(--neon-cyan);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-container {
    position: relative;
    width: 100%;
    height: 350px;
    background: #0a0a0a;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.preview-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    gap: 1rem;
}

.preview-placeholder i {
    font-size: 3rem;
    opacity: 0.3;
}

.preview-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    border-left: 4px solid var(--neon-cyan);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    animation: toastSlide 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@keyframes toastSlide {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-left-color: var(--neon-green);
}

.toast.error {
    border-left-color: #ff4444;
}

/* Overlay Page */
.overlay-container {
    position: fixed;
    inset: 0;
    background: transparent;
    overflow: hidden;
}

.overlay-video {
    position: absolute;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.overlay-text {
    position: absolute;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    font-family: var(--font-display);
    font-size: 2rem;
    color: white;
}

.countdown-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-size: 8rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 0 20px var(--neon-cyan), 0 0 40px var(--neon-magenta);
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-tabs {
        display: none;
    }

    .triggers-list,
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.flex {
    display: flex;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

/* Template Select */
.template-select {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
}

.template-btn {
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
}

.template-btn:hover {
    border-color: var(--neon-cyan);
    color: var(--text-primary);
}

.template-btn.active {
    background: rgba(0, 245, 255, 0.1);
    border-color: var(--neon-cyan);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.2);
}

/* Prediction / Preview Panel */
.preview-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.preview-container {
    flex: 1;
    background: #000;
    border-radius: 12px;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-height: 250px;
    border: 1px solid var(--border-color);
}

.preview-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.preview-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

#goalPreviewFrame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Profiles */
.profiles-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.profile-card {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    transition: var(--transition-normal);
}

.profile-card.active {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 245, 255, 0.2);
    position: relative;
}

.profile-card.active::after {
    content: 'ACTIVE';
    position: absolute;
    top: -10px;
    right: 10px;
    background: var(--neon-cyan);
    color: #000;
    font-size: 0.6rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 1px;
}

.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(0, 255, 136, 0.2);
    color: var(--neon-green);
    border: 1px solid var(--neon-green);
}

.mt-1 {
    margin-top: 0.5rem;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* Assignment Action Bar */
.assignment-action-bar,
.assignment-action-bar-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    gap: 1rem;
}

.assignment-action-bar-bottom {
    flex-wrap: wrap;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.btn-assign-full {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

.assignment-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.assignment-status i {
    color: var(--text-muted);
}

#selectedGiftDisplay {
    color: #ffd700;
    font-weight: 600;
}

#selectedTriggersDisplay {
    color: var(--neon-magenta);
    font-weight: 600;
}

.assignment-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.min-coins-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.min-coins-input input {
    width: 60px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 0.25rem;
}

.min-coins-input input:focus {
    outline: none;
}

.btn-success {
    background: linear-gradient(135deg, #00ff88, #00cc66);
    color: #000;
    font-weight: 600;
}

.btn-success:hover:not(:disabled) {
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.btn-success:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Selection States */
.gift-assignment-item.selected {
    border-color: #00ffff !important;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.8), 0 0 40px rgba(0, 255, 255, 0.4);
    background: rgba(0, 255, 255, 0.1);
}

@keyframes giftGlow {
    from {
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.8), 0 0 40px rgba(0, 255, 255, 0.4);
    }

    to {
        box-shadow: 0 0 30px rgba(0, 255, 255, 1), 0 0 60px rgba(0, 255, 255, 0.6);
    }
}

.trigger-card.selected {
    border-color: var(--neon-magenta) !important;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.6);
    background: rgba(255, 0, 255, 0.15);
}

.trigger-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.trigger-card.disabled .trigger-actions {
    pointer-events: auto;
}

.gift-assignment-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Trigger Tab Two-Column Layout */
.trigger-tab-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.trigger-column,
.gift-assignment-column {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.trigger-column .triggers-list {
    grid-template-columns: 1fr;
}

/* Gift Assignment Grid */
.gift-assignment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.75rem;
    max-height: 500px;
    overflow-y: auto;
    padding: 0.5rem;
}

.gift-assignment-item {
    position: relative;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-normal);
}

.gift-assignment-item:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    border-color: var(--neon-cyan);
}

.gift-assignment-item.has-assignment {
    /* No border change, only badges show assignment status */
}

.gift-assignment-item.special-gift {
    /* Gold border only on hover, not permanent */
}

.gift-assignment-item.special-gift:hover {
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.gift-assignment-item.special-gift.has-assignment {
    /* No border change */
}

.gift-assignment-item img {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.5rem;
    object-fit: contain;
    display: block;
}

.gift-assignment-item .gift-name {
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gift-assignment-item .gift-sub {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 2px;
    opacity: 0.7;
}

/* Like Input Card */
.gift-assignment-item.like-input-card {
    padding: 0.5rem;
    min-width: 100px;
}

.like-threshold-input {
    width: 100%;
    padding: 0.35rem 0.5rem;
    margin-top: 0.25rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.75rem;
    text-align: center;
}

.like-threshold-input:focus {
    outline: none;
    border-color: #ff4757;
    box-shadow: 0 0 8px rgba(255, 71, 87, 0.3);
}

.btn-like-assign {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.35rem 0.5rem;
    background: linear-gradient(135deg, #ff4757, #ff6b81);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-like-assign:hover {
    background: linear-gradient(135deg, #ff6b81, #ff4757);
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.5);
    transform: translateY(-1px);
}

.gift-assignment-item .gift-diamonds {
    font-size: 0.65rem;
    color: #ffd700;
    margin-top: 2px;
    font-weight: bold;
}

.gift-assignment-item .trigger-count-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--gradient-neon);
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gift-assignment-item .min-coins-badge {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #000;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 3px;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.gift-assignment-item .min-coins-badge img {
    width: 12px;
    height: 12px;
}

/* Gift Assignment Modal */
.gift-assignment-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.gift-assignment-info img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.gift-assignment-info .gift-details h4 {
    margin: 0 0 0.25rem 0;
    color: var(--neon-cyan);
}

.gift-assignment-info .gift-details span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Trigger Checkbox List */
.trigger-checkbox-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
}

.trigger-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition-normal);
}

.trigger-checkbox-item:last-child {
    border-bottom: none;
}

.trigger-checkbox-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.trigger-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--neon-cyan);
}

.trigger-checkbox-item label {
    flex: 1;
    cursor: pointer;
    font-size: 0.9rem;
}

.trigger-checkbox-item .trigger-info {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Assignment Summary Section */
.assignment-summary-section {
    margin-top: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.assignment-summary-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 600px;
    overflow-y: auto;
}

.assignment-summary-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: var(--transition-normal);
}

.assignment-summary-item:hover {
    border-color: var(--neon-cyan);
}

.assignment-summary-item.selected {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    background: rgba(255, 215, 0, 0.1);
}

.assignment-summary-item .delete-btn {
    padding: 0.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-normal);
}

.assignment-summary-item .delete-btn:hover {
    border-color: #ff4444;
    color: #ff4444;
}

.assignment-summary-item .random-btn {
    padding: 0.5rem;
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.2), rgba(255, 100, 0, 0.2));
    border: 1px solid #ffa500;
    border-radius: 8px;
    color: #ffa500;
    cursor: pointer;
    transition: var(--transition-normal);
}

.assignment-summary-item .random-btn:hover {
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.4), rgba(255, 100, 0, 0.4));
    box-shadow: 0 0 15px rgba(255, 165, 0, 0.5);
    color: #fff;
}

.badge-random {
    background: linear-gradient(135deg, #ffa500, #ff6400);
    color: #fff;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.assignment-summary-item .gift-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
}

.assignment-summary-item .gift-name {
    font-weight: 600;
    color: var(--neon-magenta);
    min-width: 120px;
}

.assignment-summary-item .min-coins {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 80px;
}

.assignment-summary-item .trigger-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
}

.assignment-summary-item .trigger-tag {
    background: linear-gradient(135deg, rgba(0, 245, 255, 0.2), rgba(255, 0, 255, 0.2));
    border: 1px solid var(--neon-cyan);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--neon-cyan);
}

.assignment-summary-item .edit-btn {
    padding: 0.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-normal);
}

.assignment-summary-item .edit-btn:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

/* Input with Icon */
.input-with-icon {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.input-with-icon .input-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.input-with-icon .form-input {
    flex: 1;
}

/* Leaderboard */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    transition: var(--transition-normal);
}

.leaderboard-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.leaderboard-item .rank {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.leaderboard-item .rank.top-1 {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #000;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.leaderboard-item .rank.top-2 {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: #000;
}

.leaderboard-item .rank.top-3 {
    background: linear-gradient(135deg, #cd7f32, #b87333);
    color: #fff;
}

.leaderboard-item .name {
    flex: 1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-item .value {
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}