/* ==========================================================================
   MapleStory Horntail Boss Run Planner - Modern CSS Design System
   ========================================================================== */

/* Design Tokens & Theme Variables */
:root {
    --bg-primary: #0a0813;
    --bg-secondary: #141124;
    --glass-bg: rgba(20, 17, 36, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f5f4f9;
    --text-muted: #a19ebb;
    
    /* Harmonious Curated Colors */
    --color-primary: #8f65ff;      /* Vivid Purple */
    --color-primary-hover: #a382ff;
    --color-accent: #ff477e;       /* Sweet Pink */
    
    /* Preset Tag Themes */
    --tag-dps-border: #d84848;     /* Classic Red */
    --tag-dps-bg: #ffffff;
    --tag-dps-text: #111111;
    
    --tag-support-border: #cca025;  /* Bishop Gold */
    --tag-support-bg: #fffdf2;
    --tag-support-text: #6d5102;
    
    --tag-tank-border: #2b7bc4;     /* Knight Blue */
    --tag-tank-bg: #f2f7fc;
    --tag-tank-text: #0f3d68;
    
    --tag-seduce-border: #a43cb8;   /* Seduce Sucker Purple */
    --tag-seduce-bg: #faf2fc;
    --tag-seduce-text: #591666;

    /* Base Dimensions */
    --sidebar-width: 340px;
    
    /* Transition Timings */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
}

/* App Container Layout */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Floating Glassmorphic Sidebar / Dock */
.control-panel {
    width: var(--sidebar-width);
    height: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-right: 1px solid var(--glass-border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 100;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

/* Custom Scrollbar for Sidebar */
.control-panel::-webkit-scrollbar {
    width: 6px;
}
.control-panel::-webkit-scrollbar-track {
    background: transparent;
}
.control-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.control-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Logo and Header */
.panel-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.logo-icon {
    font-size: 26px;
    color: var(--color-primary);
    filter: drop-shadow(0 0 8px rgba(143, 101, 255, 0.6));
    animation: pulse 3s infinite alternate;
}
.logo-text h1 {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #fff 30%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.logo-text span {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Panel Sections */
.panel-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.panel-section h2 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.panel-section h2 i {
    color: var(--color-primary);
    font-size: 14px;
}
.section-subtitle {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 4px;
}

/* Buttons & Button Groups */
.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
}
.btn-full {
    width: 100%;
}
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, #733cff 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(143, 101, 255, 0.4);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(143, 101, 255, 0.6);
    background: linear-gradient(135deg, var(--color-primary-hover) 0%, #8250ff 100%);
}
.btn-primary:active {
    transform: translateY(0);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.15);
}
.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    filter: brightness(1.1);
}
.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
    filter: brightness(1.1);
}

/* Preset Cards Grid */
.presets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.btn-preset {
    padding: 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
}
.btn-preset img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 4px;
    pointer-events: none;
}
.btn-preset:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

/* Dynamic colors matching roles */
.btn-role-dps {
    background-color: var(--tag-dps-bg);
    color: var(--tag-dps-text);
    border-color: var(--tag-dps-border);
    box-shadow: inset 0 0 0 1px white, 0 4px 10px rgba(216, 72, 72, 0.25);
}
.btn-role-support {
    background-color: var(--tag-support-bg);
    color: var(--tag-support-text);
    border-color: var(--tag-support-border);
    box-shadow: inset 0 0 0 1px white, 0 4px 10px rgba(204, 160, 37, 0.25);
}
.btn-role-tank {
    background-color: var(--tag-tank-bg);
    color: var(--tag-tank-text);
    border-color: var(--tag-tank-border);
    box-shadow: inset 0 0 0 1px white, 0 4px 10px rgba(43, 123, 196, 0.25);
}
.btn-role-seduce {
    background-color: var(--tag-seduce-bg);
    color: var(--tag-seduce-text);
    border-color: var(--tag-seduce-border);
    box-shadow: inset 0 0 0 1px white, 0 4px 10px rgba(164, 60, 184, 0.25);
}

/* File Upload Controls */
.upload-area {
    position: relative;
    width: 100%;
}
.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-normal);
    color: var(--text-muted);
}
.upload-label:hover {
    border-color: var(--color-primary);
    color: var(--text-main);
    background: rgba(143, 101, 255, 0.05);
}
.upload-label i {
    font-size: 22px;
}
.upload-label span {
    font-size: 12px;
    font-weight: 600;
}

/* Workspace Tool Switches */
.toggle-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 6px 0;
}
.scale-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 4px;
}
.scale-control input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}
.scale-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 0 8px rgba(143, 101, 255, 0.6);
}
.scale-control input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--color-primary-hover);
    transform: scale(1.2);
}

/* Toggle Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
.switch input:checked + .slider {
    background-color: var(--color-primary);
}
.switch input:checked + .slider:before {
    transform: translateX(22px);
}

/* Panel Footer & Help Info */
.panel-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 16px;
}
.help-tips {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}
.help-tips p {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}
.help-tips p i {
    color: var(--color-primary);
    margin-top: 2px;
}

/* ==========================================================================
   Workspace Viewport & Interactive Canvas
   ========================================================================== */
.workspace-viewport {
    flex: 1;
    height: 100vh;
    overflow: auto;
    background-color: #05040a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    /* Fancy radial gradient for standard gaming workspace backdrop */
    background-image: radial-gradient(circle at center, #1b1632 0%, #05040a 100%);
}

.planner-canvas {
    position: relative;
    width: 1600px;
    height: 900px;
    background-color: #141124;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    overflow: hidden;
    border: 4px solid #231f38;
    user-select: none;
    flex-shrink: 0;
}

#canvas-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* Grid Overlay Option */
.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: 
        linear-gradient(rgba(143, 101, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(143, 101, 255, 0.06) 1px, transparent 1px);
    background-size: 64px 64px;
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: 5;
}
.grid-overlay.active {
    opacity: 1;
}

/* Cards Container Layer */
.cards-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none; /* Make container click-through, items will enable mouse events */
}

/* ==========================================================================
   MapleStory Style Bubble Tags (Cards)
   ========================================================================== */
.maple-tag {
    position: absolute;
    pointer-events: auto; /* Active for mouse/pointer drag */
    cursor: grab;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    padding: 8px 18px;
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    
    /* Perfect CSS representation of MS name tag double border */
    border: 3.5px solid var(--tag-border-color, var(--tag-dps-border));
    background-color: var(--tag-bg-color, var(--tag-dps-bg));
    color: var(--tag-text-color, var(--tag-dps-text));
    
    /* Outer stroke effect for text & inner border spacing via box-shadow */
    box-shadow: 
        inset 0 0 0 2px #ffffff, 
        inset 0 0 0 4.5px var(--tag-border-color, var(--tag-dps-border)),
        0 6px 16px rgba(0, 0, 0, 0.35);
        
    /* Text stroke hack using text-shadow to closely mirror 8-bit style MS game fonts */
    text-shadow: 
        -1.5px -1.5px 0 #fff,  
         1.5px -1.5px 0 #fff,
        -1.5px  1.5px 0 #fff,
         1.5px  1.5px 0 #fff;

    transform-origin: center center;
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.maple-tag .tag-icon {
    width: 24px;
    height: 24px;
    margin-right: 6px;
    object-fit: contain;
    border-radius: 4px;
    pointer-events: none;
    vertical-align: middle;
}

.maple-tag:hover {
    box-shadow: 
        inset 0 0 0 2px #ffffff, 
        inset 0 0 0 4.5px var(--tag-border-color, var(--tag-dps-border)),
        0 8px 24px rgba(0, 0, 0, 0.45);
    transform: scale(1.03);
}

.maple-tag:active {
    cursor: grabbing;
    box-shadow: 
        inset 0 0 0 2px #ffffff, 
        inset 0 0 0 4.5px var(--tag-border-color, var(--tag-dps-border)),
        0 3px 8px rgba(0, 0, 0, 0.5);
    transform: scale(0.98);
}

/* Edit Mode Text Box Override */
.maple-tag input.tag-edit-input {
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
    color: inherit;
    text-align: center;
    width: 80px;
    padding: 0;
    margin: 0;
    /* Text outline effect for input */
    text-shadow: 
        -1.5px -1.5px 0 #fff,  
         1.5px -1.5px 0 #fff,
        -1.5px  1.5px 0 #fff,
         1.5px  1.5px 0 #fff;
}

/* Delete Close Icon Button */
.maple-tag .tag-delete-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #ef4444;
    color: white;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    opacity: 0;
    pointer-events: auto;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    z-index: 15;
}

.maple-tag:hover .tag-delete-btn {
    opacity: 1;
}

.maple-tag .tag-delete-btn:hover {
    transform: scale(1.2);
    background-color: #dc2626;
}

/* Role Modifier Classes */
.maple-tag.role-dps {
    --tag-border-color: var(--tag-dps-border);
    --tag-bg-color: var(--tag-dps-bg);
    --tag-text-color: var(--tag-dps-text);
}
.maple-tag.role-support {
    --tag-border-color: var(--tag-support-border);
    --tag-bg-color: var(--tag-support-bg);
    --tag-text-color: var(--tag-support-text);
}
.maple-tag.role-tank {
    --tag-border-color: var(--tag-tank-border);
    --tag-bg-color: var(--tag-tank-bg);
    --tag-text-color: var(--tag-tank-text);
}
.maple-tag.role-seduce {
    --tag-border-color: var(--tag-seduce-border);
    --tag-bg-color: var(--tag-seduce-bg);
    --tag-text-color: var(--tag-seduce-text);
}

/* Icon-Only mode for tags on canvas */
.maple-tag.icon-only {
    background: none !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5) !important;
    padding: 0 !important;
    border-radius: 4px !important;
    min-width: 0 !important;
    width: 40px !important;
    height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.maple-tag.icon-only .tag-icon {
    width: 40px !important;
    height: 40px !important;
    margin-right: 0 !important;
    border-radius: 4px !important;
}

.maple-tag.icon-only .tag-text {
    display: none !important;
}

.maple-tag.icon-only:hover {
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.7) !important;
    transform: scale(1.08) !important;
}

.maple-tag.icon-only:active {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.8) !important;
    transform: scale(0.95) !important;
}


/* ==========================================================================
   Popup Toast & Animations
   ========================================================================== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 24px;
    border-radius: 10px;
    background: rgba(15, 12, 30, 0.95);
    border: 1px solid var(--color-primary);
    box-shadow: 0 10px 30px rgba(143, 101, 255, 0.3);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Keyframe Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 4px rgba(143, 101, 255, 0.4));
    }
    100% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 12px rgba(143, 101, 255, 0.8));
    }
}

/* ==========================================================================
   MapleStory Security Login Screen
   ========================================================================== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(20, 20, 35, 0.96) 0%, rgba(10, 10, 15, 0.98) 100%);
    backdrop-filter: blur(16px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
}

.login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-box {
    width: 380px;
    background: rgba(30, 30, 45, 0.85);
    border: 3.5px solid #a855f7;
    box-shadow: 
        inset 0 0 0 2px #ffffff,
        inset 0 0 0 4.5px #a855f7,
        0 20px 50px rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    overflow: hidden;
    animation: loginBounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes loginBounce {
    0% { transform: scale(0.7) translateY(-30px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.login-header {
    background: linear-gradient(90deg, #a855f7 0%, #7c3aed 100%);
    color: #ffffff;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid #7c3aed;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.login-body {
    padding: 30px 24px;
    text-align: center;
}

.login-avatar-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(124, 58, 237, 0.2) 100%);
    border: 2px dashed #a855f7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

.login-avatar {
    font-size: 36px;
    color: #c084fc;
    animation: avatarFloat 3s ease-in-out infinite;
}

@keyframes avatarFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.login-instructions {
    color: #e2e8f0;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.login-box .input-wrapper {
    position: relative;
    margin-bottom: 12px;
}

.login-box input[type="password"],
.login-box input[type="number"] {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: rgba(15, 15, 25, 0.8);
    border: 2px solid #4b5563;
    border-radius: 8px;
    color: #ffffff;
    font-size: 16px;
    letter-spacing: 0.1em;
    font-family: monospace, sans-serif;
    transition: all 0.3s;
    box-sizing: border-box;
}

/* Remove up/down spinner arrows on input[type="number"] */
.login-box input[type="number"]::-webkit-outer-spin-button,
.login-box input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.login-box input[type="number"] {
    -moz-appearance: textfield;
}

.login-box input[type="password"]::placeholder,
.login-box input[type="number"]::placeholder {
    letter-spacing: normal;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 14px;
    color: #6b7280;
}

.login-box input[type="password"]:focus,
.login-box input[type="number"]:focus {
    outline: none;
    border-color: #a855f7;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

.login-box .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
    transition: color 0.3s;
}

.login-box input[type="password"]:focus + .input-icon,
.login-box input[type="number"]:focus + .input-icon {
    color: #c084fc;
}

.login-error-msg {
    color: #f87171;
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s;
}

.login-error-msg.visible {
    opacity: 1;
    transform: translateY(0);
}

.login-box.shake {
    animation: loginShake 0.4s ease;
}

@keyframes loginShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

.login-footer {
    padding: 16px 24px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-login-submit {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px;
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    border: none;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
    transition: all 0.3s;
}

.btn-login-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
    filter: brightness(1.1);
}

/* Split button footer */
.login-footer-split {
    display: flex;
    gap: 12px;
    padding: 16px 24px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-half {
    flex: 1;
}

/* Disabled button state */
.btn-disabled {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    pointer-events: none !important;
}

/* Dialog Overlay for password setting / verification */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.dialog-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.dialog-box {
    width: 360px;
    max-width: 90vw;
    background: rgba(30, 30, 45, 0.95);
    border: 3px solid #a855f7;
    box-shadow: 
        inset 0 0 0 2px #ffffff,
        inset 0 0 0 4px #a855f7,
        0 20px 40px rgba(0, 0, 0, 0.7);
    border-radius: 12px;
    overflow: hidden;
    animation: loginBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dialog-header {
    background: linear-gradient(90deg, #a855f7 0%, #7c3aed 100%);
    color: #ffffff;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 700;
    border-bottom: 2px solid #7c3aed;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dialog-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    margin: 0;
    transition: color 0.2s;
}

.dialog-close-btn:hover {
    color: #ffffff;
}

.dialog-body {
    padding: 24px 20px;
    text-align: center;
}

.dialog-body p {
    font-size: 14px;
    color: #e2e8f0;
    margin-bottom: 16px;
    line-height: 1.5;
}

.dialog-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Card Icon Wrapper & Sequence Badge Styling */
.maple-tag .tag-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
}

.maple-tag.icon-only .tag-icon-wrapper {
    margin-right: 0;
}

.maple-tag .tag-icon-wrapper .tag-icon {
    margin-right: 0 !important;
}

.tag-sequence-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: #ef4444; /* Retro crimson red sequence badge */
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 5;
    pointer-events: none;
    font-family: 'Outfit', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: none; /* Reset text shadow of parent name tag */
}

