/* Unified UI System Styles */

/* Main Container */
.unified-ui {
    position: fixed;
    top: 0;
    width: 480px;
    height: 100vh;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    z-index: 10000;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

/* Position variations */
.unified-ui.right {
    right: 0;
    transform: translateX(100%);
}

.unified-ui.right.visible {
    transform: translateX(0);
}

.unified-ui.left {
    left: 0;
    transform: translateX(-100%);
}

.unified-ui.left.visible {
    transform: translateX(0);
}

.unified-ui.overlay {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 800px;
    height: 600px;
    opacity: 0;
    border-radius: 12px;
}

.unified-ui.overlay.visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.unified-ui.hidden {
    pointer-events: none;
}

.unified-ui.visible {
    pointer-events: auto;
}

/* Header */
.unified-ui-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    background: rgba(30, 30, 30, 0.8);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

/* Tab Navigation */
.unified-ui-tabs {
    display: flex;
    flex: 1;
}

.unified-ui-tab-btn {
    flex: 1;
    padding: 16px 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.unified-ui-tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
}

.unified-ui-tab-btn.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.unified-ui-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #4a9eff;
}

.tab-icon {
    font-size: 18px;
}

.tab-label {
    font-size: 14px;
}

/* Close Button */
.unified-ui-close {
    padding: 16px 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
}

.unified-ui-close:hover {
    background: rgba(255, 0, 0, 0.2);
    color: #ff4444;
}

/* Content Area */
.unified-ui-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Tab Content Base */
.unified-ui-tab-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sections */
.tab-section {
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.section-header {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 500;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Buttons */
.tab-button {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    margin: 4px;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.tab-button.primary {
    background: #4a9eff;
    border-color: #4a9eff;
}

.tab-button.primary:hover {
    background: #5fa8ff;
}

.tab-button.danger {
    background: #ff4444;
    border-color: #ff4444;
}

.tab-button.danger:hover {
    background: #ff5555;
}

/* Stat Displays */
.stat-display {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-label {
    color: rgba(255, 255, 255, 0.7);
}

.stat-value {
    color: #fff;
    font-weight: 500;
}

/* Game Tab Specific */
.pause-button {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    margin-bottom: 12px;
}

.audio-controls,
.volume-controls {
    margin: 16px 0;
}

.controls-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.control-key {
    font-weight: 600;
    color: #4a9eff;
}

/* Toggle Controls */
.toggle-control {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
    cursor: pointer;
}

.toggle-control input {
    display: none;
}

.toggle-slider {
    width: 48px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    position: relative;
    transition: background 0.3s ease;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
}

.toggle-control input:checked + .toggle-slider {
    background: #4a9eff;
}

.toggle-control input:checked + .toggle-slider::after {
    transform: translateX(24px);
}

/* Slider Controls */
.slider-control {
    margin: 16px 0;
}

.slider-label {
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
}

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-wrapper input[type="range"] {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
}

.slider-wrapper input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #4a9eff;
    border-radius: 50%;
    cursor: pointer;
}

.slider-value {
    min-width: 48px;
    text-align: right;
    color: #4a9eff;
}

/* Stats Tab Specific */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-icon {
    font-size: 24px;
}

.stat-info {
    flex: 1;
}

.stat-info .stat-label {
    font-size: 12px;
    margin-bottom: 4px;
}

.stat-info .stat-value {
    font-size: 18px;
    font-weight: 600;
}

/* Weapons Display */
.weapons-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.weapon-card {
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.weapon-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.weapon-icon {
    font-size: 20px;
}

.weapon-name {
    flex: 1;
    font-weight: 500;
}

.weapon-level {
    color: #4a9eff;
    font-weight: 600;
}

.weapon-stats {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.weapon-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.weapon-evolution-progress {
    margin-top: 8px;
}

.evolution-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.evolution-fill {
    height: 100%;
    background: #4a9eff;
    transition: width 0.3s ease;
}

.evolution-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* Achievement Display */
.achievement-progress {
    margin-bottom: 16px;
}

.achievement-progress-bar {
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.achievement-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a9eff, #44ff88);
    transition: width 0.5s ease;
}

.achievement-progress-text {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.achievement-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-bottom: 8px;
}

.achievement-icon {
    font-size: 24px;
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.achievement-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* Debug Tab Specific */
.debug-warning {
    padding: 12px;
    background: rgba(255, 165, 0, 0.2);
    border: 1px solid rgba(255, 165, 0, 0.4);
    color: #ffa500;
    text-align: center;
    border-radius: 6px;
    margin-bottom: 16px;
}

.speed-toggle-btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    margin-bottom: 12px;
}

.speed-toggle-btn.active {
    background: #44ff88;
    color: #000;
}

.speed-display {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #4a9eff;
}

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

.state-display {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.weapon-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.weapon-selector {
    flex: 1;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 4px;
}

.perf-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.perf-stats {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

/* Systems Tab Specific */
.system-info {
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.audio-status {
    margin-bottom: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.effect-toggles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quality-select {
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 4px;
    margin-left: 8px;
}

.combo-card,
.evolution-card,
.ultimate-card {
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.combo-card.active,
.ultimate-card.active {
    border-color: #44ff88;
}

.energy-bar {
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.energy-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff44ff, #44ffff);
    transition: width 0.3s ease;
}

/* Utility Classes */
.no-weapons,
.no-achievements,
.system-disabled {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    padding: 20px;
}

.subsection-title {
    margin: 16px 0 8px 0;
    font-size: 16px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

/* Scrollbar Styling */
.unified-ui-content::-webkit-scrollbar {
    width: 8px;
}

.unified-ui-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.unified-ui-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.unified-ui-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive adjustments for smaller screens */
@media (max-height: 600px) {
    .unified-ui {
        width: 400px;
    }
    
    .tab-section {
        padding: 12px;
        margin-bottom: 16px;
    }
    
    .section-header {
        font-size: 16px;
        margin-bottom: 12px;
    }
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 16px 20px;
    min-width: 300px;
    max-width: 450px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    font-size: 14px;
    transform: translateX(120%);
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: all;
    border-left: 4px solid #4a90e2;
}

.toast.visible {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-message {
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    margin-left: 12px;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* Toast type variations */
.toast-info {
    border-left-color: #4a90e2;
}

.toast-success {
    border-left-color: #4caf50;
}

.toast-warning {
    border-left-color: #ff9800;
}

.toast-error {
    border-left-color: #f44336;
}

.toast-unlock {
    border-left-color: #9c27b0;
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.2), rgba(30, 30, 30, 0.95));
}

.toast-achievement {
    border-left-color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(30, 30, 30, 0.95));
}

/* Music Track Section */
.music-track-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.track-selector-label {
    display: block;
    color: var(--ui-text-secondary);
    font-size: 0.9em;
    margin-bottom: 5px;
}

.track-selector {
    width: 100%;
    padding: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--ui-border);
    border-radius: 4px;
    color: var(--ui-text);
    font-size: 0.9em;
    cursor: pointer;
}

.track-selector:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: var(--ui-primary);
}

.track-selector:focus {
    outline: none;
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 2px rgba(100, 149, 237, 0.2);
}
