/* ⚙️ Settings Panel - Morrhollow Security Terminal Style (Matching Social Hub) */

:root {
    --hc-gap-xs: 3px;
    --hc-gap-sm: 4px;
    --hc-gap-md: 6px;
    --hc-gap-lg: 8px;
    --hc-pad-xs: 4px;
    --hc-pad-sm: 6px;
    --hc-pad-md: 8px;
    --hc-pad-lg: 12px;

    /* Morrhollow Terminal Colors */
    --hc-bg-dark: rgba(15, 15, 25, 0.95);
    --hc-bg-darker: rgba(8, 8, 15, 0.98);
    --hc-blue-glow: #93C5FD;
    --hc-blue-accent: #00d4ff;
    --hc-gold-accent: rgba(212, 175, 55, 0.9);
    --hc-gold-border: rgba(212, 175, 55, 0.4);
}

/* ========================================
   PANEL CONTAINER (Match Social Hub)
   ======================================== */

.panel-settings {
    position: fixed;
    top: 50px;
    left: 10px;
    width: min(1000px, calc(100vw - 20px));
    max-width: 1000px;
    height: calc(100vh - 100px);
    max-height: 700px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    border-radius: 6px;
    overflow: hidden;
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 40px rgba(147, 197, 253, 0.15),
        0 0 20px rgba(212, 175, 55, 0.1);
    border: 1px solid var(--hc-gold-border);
    font-family: 'RemiliaMincho', serif;
    font-size: 12px;
    color: #E5E7EB;
    user-select: none;
    background: transparent;
    animation: hc-panel-slide-in 0.3s ease-out;
    margin: 0;
    padding: 0;
}

.panel-settings .panel-content {
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.panel-settings .panel-close {
    display: none !important;
}

@keyframes hc-panel-slide-in {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.panel-settings::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg,
        var(--hc-bg-dark) 0%,
        var(--hc-bg-darker) 50%,
        var(--hc-bg-dark) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: -1;
}

/* ========================================
   HEADER (Compact like Social Hub)
   ======================================== */

.panel-settings .panel-header {
    background: linear-gradient(180deg,
        rgba(30, 41, 59, 0.95) 0%,
        rgba(51, 65, 85, 0.98) 100%);
    min-height: 30px;
    max-height: 30px;
    border-bottom: 1px solid var(--hc-gold-border);
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 2px 10px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(147, 197, 253, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    margin: 0;
    flex-shrink: 0;
    position: relative;
    z-index: 20;
}

.panel-settings .panel-header h2 {
    font-size: 11px;
    color: var(--hc-gold-accent);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    opacity: 0.9;
    white-space: nowrap;
    text-shadow:
        0 0 10px rgba(147, 197, 253, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.8);
}

.panel-settings .panel-subtitle {
    display: none; /* Hide subtitle for cleaner look */
}

/* ========================================
   TABS - Compact Morrhollow Style
   ======================================== */

.settings-tabs {
    display: flex;
    gap: var(--hc-gap-sm);
    padding: var(--hc-pad-sm) var(--hc-pad-sm);
    background: linear-gradient(180deg,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.2) 100%);
    border-bottom: 1px solid var(--hc-gold-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    margin: 0;
    flex-shrink: 0;
}

.settings-tab {
    flex: 1;
    min-height: 24px;
    padding: var(--hc-pad-sm) var(--hc-pad-md);
    background: linear-gradient(135deg,
        rgba(30, 41, 59, 0.4) 0%,
        rgba(51, 65, 85, 0.5) 100%);
    border: 1px solid rgba(147, 197, 253, 0.15);
    border-radius: 3px;
    color: rgba(186, 166, 116, 0.7);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 1px 2px rgba(0, 0, 0, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.settings-tab:hover {
    background: linear-gradient(135deg,
        rgba(147, 197, 253, 0.2) 0%,
        rgba(59, 130, 246, 0.3) 100%);
    border-color: var(--hc-blue-glow);
    color: rgba(186, 166, 116, 0.95);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 8px rgba(147, 197, 253, 0.2),
        0 1px 3px rgba(0, 0, 0, 0.3);
}

.settings-tab.active {
    background: linear-gradient(135deg,
        rgba(0, 212, 255, 0.25) 0%,
        rgba(0, 153, 204, 0.35) 100%);
    border-color: var(--hc-blue-accent);
    color: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 12px rgba(0, 212, 255, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.4);
}

/* ========================================
   CONTENT AREA
   ======================================== */

.settings-panel-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.settings-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar */
.settings-content::-webkit-scrollbar {
    width: 6px;
}

.settings-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.settings-content::-webkit-scrollbar-thumb {
    background: rgba(147, 197, 253, 0.3);
    border-radius: 3px;
}

.settings-content::-webkit-scrollbar-thumb:hover {
    background: rgba(147, 197, 253, 0.5);
}

.settings-tab-content {
    display: none;
    padding: var(--hc-pad-lg);
    animation: fadeIn 0.2s ease-in;
}

.settings-tab-content.active {
    display: block;
}

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

/* ========================================
   SECTIONS
   ======================================== */

.settings-section {
    background: linear-gradient(135deg,
        rgba(30, 41, 59, 0.3) 0%,
        rgba(51, 65, 85, 0.4) 100%);
    border: 1px solid rgba(147, 197, 253, 0.15);
    border-radius: 4px;
    padding: var(--hc-pad-lg);
    margin-bottom: var(--hc-pad-lg);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--hc-gold-accent);
    margin: 0 0 var(--hc-pad-md) 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ========================================
   OPTIONS & CONTROLS
   ======================================== */

.settings-option {
    margin-bottom: var(--hc-pad-lg);
}

.settings-option:last-child {
    margin-bottom: 0;
}

.settings-label {
    display: flex;
    align-items: center;
    gap: var(--hc-pad-sm);
    color: rgba(229, 231, 235, 0.9);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.settings-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--hc-blue-accent);
}

.settings-description {
    margin: var(--hc-pad-xs) 0 0 0;
    color: rgba(186, 166, 116, 0.6);
    font-size: 10px;
    line-height: 1.4;
}

/* ========================================
   SLIDERS
   ======================================== */

.settings-slider {
    margin-bottom: var(--hc-pad-lg);
}

.settings-slider:last-child {
    margin-bottom: 0;
}

.settings-slider .settings-label {
    margin-bottom: var(--hc-pad-xs);
    font-size: 10px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: var(--hc-pad-md);
}

.settings-range {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.3);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.settings-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--hc-blue-accent);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

.settings-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.8);
}

.settings-range::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--hc-blue-accent);
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

.settings-range::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.8);
}

.slider-value {
    min-width: 40px;
    text-align: right;
    color: var(--hc-blue-accent);
    font-weight: 600;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
}

/* ========================================
   SELECT DROPDOWNS
   ======================================== */

.settings-select {
    width: 100%;
    padding: var(--hc-pad-sm);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(147, 197, 253, 0.2);
    border-radius: 3px;
    color: rgba(229, 231, 235, 0.9);
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: var(--hc-pad-xs);
}

.settings-select:hover {
    border-color: rgba(0, 212, 255, 0.4);
    background: rgba(0, 0, 0, 0.4);
}

.settings-select:focus {
    outline: none;
    border-color: var(--hc-blue-accent);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

/* ========================================
   TEXT INPUTS
   ======================================== */

.settings-text-input {
    width: 100%;
    padding: var(--hc-pad-sm);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(147, 197, 253, 0.2);
    border-radius: 3px;
    color: rgba(229, 231, 235, 0.9);
    font-size: 11px;
    font-family: 'RemiliaMincho', serif;
    transition: all 0.2s;
}

.settings-text-input:hover {
    border-color: rgba(0, 212, 255, 0.4);
    background: rgba(0, 0, 0, 0.4);
}

.settings-text-input:focus {
    outline: none;
    border-color: var(--hc-blue-accent);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

.settings-text-input::placeholder {
    color: rgba(186, 166, 116, 0.4);
}

/* ========================================
   BUTTONS
   ======================================== */

.settings-btn {
    padding: var(--hc-pad-sm) var(--hc-pad-lg);
    border-radius: 3px;
    border: 1px solid;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: var(--hc-pad-sm);
    margin-right: var(--hc-pad-sm);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 1px 2px rgba(0, 0, 0, 0.3);
}

.settings-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.settings-btn.primary {
    background: linear-gradient(135deg,
        rgba(0, 212, 255, 0.8) 0%,
        rgba(0, 153, 204, 0.9) 100%);
    color: #000;
    border-color: var(--hc-blue-accent);
}

.settings-btn.primary:hover:not(:disabled) {
    background: linear-gradient(135deg,
        rgba(0, 212, 255, 1) 0%,
        rgba(0, 153, 204, 1) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 12px rgba(0, 212, 255, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.4);
}

.settings-btn.secondary {
    background: linear-gradient(135deg,
        rgba(30, 41, 59, 0.6) 0%,
        rgba(51, 65, 85, 0.7) 100%);
    color: rgba(186, 166, 116, 0.9);
    border-color: rgba(147, 197, 253, 0.2);
}

.settings-btn.secondary:hover:not(:disabled) {
    background: linear-gradient(135deg,
        rgba(147, 197, 253, 0.3) 0%,
        rgba(59, 130, 246, 0.4) 100%);
    border-color: var(--hc-blue-glow);
    color: #fff;
}

.settings-btn.danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
}

.settings-btn.danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 8px rgba(239, 68, 68, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.3);
}

.settings-btn.compact {
    padding: var(--hc-pad-xs) var(--hc-pad-md);
    font-size: 9px;
    margin-top: 0;
}

/* ========================================
   AVATAR SELECTOR (Profile Customization)
   ======================================== */

.avatar-selector {
    display: flex;
    gap: var(--hc-pad-md);
    align-items: center;
    margin-top: var(--hc-pad-sm);
}

.current-avatar-display {
    flex-shrink: 0;
}

.settings-avatar-preview {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    border: 2px solid var(--hc-blue-accent);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
    object-fit: cover;
}

.avatar-options {
    display: flex;
    gap: var(--hc-pad-xs);
    flex-wrap: wrap;
}

.avatar-option {
    width: 40px;
    height: 40px;
    border-radius: 3px;
    border: 2px solid rgba(147, 197, 253, 0.2);
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

.avatar-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-option:hover {
    border-color: var(--hc-blue-accent);
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

.avatar-option.selected {
    border-color: var(--hc-blue-accent);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.5);
}

/* ========================================
   USERNAME EDITOR
   ======================================== */

.username-editor-section {
    margin-top: var(--hc-pad-lg);
}

.username-input-group {
    display: flex;
    gap: var(--hc-pad-sm);
    align-items: center;
    margin-top: var(--hc-pad-xs);
}

.username-input-group .settings-text-input {
    flex: 1;
    margin: 0;
}

/* ========================================
   ACCOUNT INFO
   ======================================== */

.settings-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--hc-pad-sm) 0;
    border-bottom: 1px solid rgba(147, 197, 253, 0.1);
}

.settings-info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: rgba(186, 166, 116, 0.7);
    font-size: 10px;
}

.info-value {
    color: rgba(229, 231, 235, 0.9);
    font-weight: 500;
    font-size: 10px;
}

/* ========================================
   WALLETS & ACCOUNTS
   ======================================== */

.connected-wallets-list,
.connected-accounts-list {
    display: flex;
    flex-direction: column;
    gap: var(--hc-pad-sm);
    margin-bottom: var(--hc-pad-md);
}

.wallet-item,
.account-item {
    display: flex;
    align-items: center;
    gap: var(--hc-pad-md);
    padding: var(--hc-pad-md);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(147, 197, 253, 0.15);
    border-radius: 3px;
    transition: all 0.2s;
}

.wallet-item:hover,
.account-item:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(0, 212, 255, 0.3);
}

.wallet-icon,
.account-icon {
    font-size: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 3px;
    flex-shrink: 0;
}

.wallet-info,
.account-info {
    flex: 1;
    min-width: 0;
}

.wallet-type,
.account-type {
    font-size: 10px;
    font-weight: 600;
    color: rgba(229, 231, 235, 0.9);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wallet-badge {
    display: inline-block;
    padding: 1px 4px;
    background: rgba(0, 212, 255, 0.2);
    color: var(--hc-blue-accent);
    border-radius: 2px;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.wallet-badge.chain {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.wallet-address,
.account-value {
    font-size: 9px;
    font-family: 'JetBrains Mono', monospace;
    color: rgba(186, 166, 116, 0.6);
}

.account-status {
    font-size: 14px;
    flex-shrink: 0;
}

.account-status.verified {
    color: #10b981;
}

.account-status.unverified {
    color: #f59e0b;
}

.copy-wallet-btn,
.unlink-wallet-btn {
    padding: var(--hc-pad-xs);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(147, 197, 253, 0.2);
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-wallet-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.4);
    box-shadow: 0 0 6px rgba(0, 212, 255, 0.3);
}

.unlink-wallet-btn {
    color: #ef4444;
}

.unlink-wallet-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.3);
}

.wallet-connect-buttons {
    display: flex;
    gap: var(--hc-pad-sm);
    flex-wrap: wrap;
}

.wallet-connect-buttons .settings-btn {
    flex: 1;
    min-width: 150px;
    justify-content: center;
}

/* ========================================
   PUSH NOTIFICATIONS
   ======================================== */

.push-notification-status {
    display: flex;
    align-items: center;
    gap: var(--hc-pad-md);
    padding: var(--hc-pad-md);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(147, 197, 253, 0.15);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.push-notification-status.enabled {
    background: rgba(76, 175, 80, 0.05);
    border-color: rgba(76, 175, 80, 0.3);
}

.push-notification-status.disabled {
    background: rgba(33, 150, 243, 0.05);
    border-color: rgba(33, 150, 243, 0.2);
}

.push-notification-status.blocked {
    background: rgba(244, 67, 54, 0.05);
    border-color: rgba(244, 67, 54, 0.3);
}

.push-notification-status.unsupported {
    background: rgba(158, 158, 158, 0.05);
    border-color: rgba(158, 158, 158, 0.2);
}

.push-notification-status .status-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.push-notification-status .status-info {
    flex: 1;
    min-width: 0;
}

.push-notification-status .status-title {
    font-weight: 600;
    color: rgba(229, 231, 235, 0.9);
    font-size: 11px;
    margin-bottom: 2px;
}

.push-notification-status .status-description {
    font-size: 9px;
    color: rgba(186, 166, 116, 0.6);
    line-height: 1.4;
}

/* ========================================
   NOTIFICATION TOAST
   ======================================== */

.settings-notification {
    position: fixed;
    top: 80px;
    right: -400px;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid var(--hc-blue-accent);
    border-radius: 4px;
    padding: var(--hc-pad-md);
    color: #fff;
    font-size: 11px;
    z-index: 999999; /* Always on top! */
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
    transition: right 0.3s ease-out;
    max-width: 300px;
}

.settings-notification.show {
    right: 20px;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .panel-settings {
        width: calc(100vw - 10px);
        left: 5px;
    }

    .settings-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .settings-tabs::-webkit-scrollbar {
        display: none;
    }

    .settings-tab {
        flex: 0 0 auto;
        min-width: 80px;
        font-size: 9px;
    }

    .settings-tab-content {
        padding: var(--hc-pad-md);
    }

    .settings-section {
        padding: var(--hc-pad-md);
    }

    .avatar-selector {
        flex-direction: column;
        align-items: flex-start;
    }

    .wallet-item,
    .account-item {
        flex-wrap: wrap;
    }

    .wallet-connect-buttons {
        flex-direction: column;
    }

    .wallet-connect-buttons .settings-btn {
        width: 100%;
        min-width: auto;
    }
}
