/* ----------------------------------------------------
   DESIGN SYSTEM & CUSTOM PROPERTIES
   ---------------------------------------------------- */
:root {
    --bg-dark: #070913;
    --card-bg: rgba(13, 17, 30, 0.45);
    --card-border: rgba(255, 255, 255, 0.06);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-indigo: #6366f1;
    --accent-purple: #a855f7;
    --accent-teal: #14b8a6;
    --accent-danger: #f43f5e;
    --accent-success: #10b981;
    
    --glow-indigo: rgba(99, 102, 241, 0.4);
    --glow-purple: rgba(168, 85, 247, 0.4);
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

/* ----------------------------------------------------
   BASE ELEMENTS
   ---------------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-dark);
    background-image: linear-gradient(rgba(7, 9, 19, 0.82), rgba(7, 9, 19, 0.92)), url('bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
    position: relative;
    padding: 1rem 0.75rem;
    line-height: 1.5;
}

@media (min-width: 600px) {
    body {
        padding: 2rem 1rem;
    }
}

/* ----------------------------------------------------
   ANIMATED BACKGROUND BLOBS (Premium Mesh Gradient)
   ---------------------------------------------------- */
.bg-blobs-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    opacity: 0.12;
    pointer-events: none;
    animation: float 20s infinite alternate ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: var(--accent-indigo);
    animation-duration: 25s;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 700px;
    height: 700px;
    background: var(--accent-purple);
    animation-duration: 30s;
}

.blob-3 {
    top: 40%;
    left: 35%;
    width: 450px;
    height: 450px;
    background: var(--accent-teal);
    animation-duration: 22s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(5%, 8%) scale(1.05); }
    100% { transform: translate(-5%, -5%) scale(0.95); }
}

/* ----------------------------------------------------
   APP LAYOUT CONTAINER
   ---------------------------------------------------- */
.app-container {
    width: 100%;
    max-width: 760px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 10;
}

@media (min-width: 600px) {
    .app-container {
        gap: 1.5rem;
    }
}

/* ----------------------------------------------------
   HEADER & LOGO AREA
   ---------------------------------------------------- */
header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    padding: 0.5rem 0;
}

@media (min-width: 600px) {
    header {
        flex-direction: row;
        justify-content: space-between;
        padding: 1rem 0;
        gap: 1.25rem;
    }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-switcher {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.25rem;
    border-radius: 99px;
    backdrop-filter: blur(10px);
}

.nav-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    border-radius: 99px;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-tab:hover {
    color: var(--text-primary);
}

.nav-tab.active {
    background: linear-gradient(135deg, var(--accent-indigo) 0%, var(--accent-purple) 100%);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25);
}

.count-badge-mini {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 0.65rem;
    padding: 0.05rem 0.35rem;
    border-radius: 99px;
    font-weight: 800;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: inherit;
}

.back-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.back-icon {
    width: 14px;
    height: 14px;
}

/* Language Selector styling */
.lang-selector {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.25rem;
    border-radius: 99px;
    backdrop-filter: blur(10px);
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 99px;
    transition: var(--transition-smooth);
}

.lang-btn:hover {
    color: var(--text-primary);
}

.lang-btn.active {
    background: linear-gradient(135deg, var(--accent-indigo) 0%, var(--accent-purple) 100%);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25);
}

.lang-divider {
    color: rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    user-select: none;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    cursor: pointer;
}

.app-logo-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(255, 255, 255, 0.25));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo-area:hover .app-logo-img {
    transform: scale(1.08) rotate(3deg);
    filter: drop-shadow(0 4px 8px rgba(255, 255, 255, 0.45));
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.logo-title .dot {
    -webkit-text-fill-color: var(--accent-teal);
    margin-left: 1px;
}

.logo-subtitle {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ----------------------------------------------------
   GLASSMORPHIC CARDS
   ---------------------------------------------------- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 20px;
    padding: 1.25rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
}

@media (min-width: 600px) {
    .card {
        border-radius: 24px;
        padding: 2.25rem;
    }
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.09);
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.35);
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* ----------------------------------------------------
   FORM INPUTS & LABELS
   ---------------------------------------------------- */
form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

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

.input-icon {
    position: absolute;
    left: 1.25rem;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition-fast);
}

input[type="url"],
input[type="text"] {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition-smooth);
    outline: none;
}

input[type="url"]:focus,
input[type="text"]:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

input[type="url"]:focus + .input-icon,
input[type="url"]:focus ~ .input-icon {
    color: var(--accent-indigo);
}

/* ----------------------------------------------------
   OPTION TABS & ALIAS PANEL
   ---------------------------------------------------- */
.option-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.35rem;
    border-radius: 14px;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.tab-icon {
    width: 18px;
    height: 18px;
    opacity: 0.6;
    transition: var(--transition-fast);
}

.tab-btn.active .tab-icon {
    opacity: 1;
    color: var(--accent-indigo);
}

.alias-input-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.alias-input-panel.open {
    max-height: 200px;
    opacity: 1;
    margin-bottom: 0.5rem;
}

.alias-input-wrapper {
    display: flex;
    align-items: stretch;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.domain-prefix {
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    background: rgba(255, 255, 255, 0.04);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 0.95rem;
    user-select: none;
}

.alias-input-wrapper input {
    border: none;
    border-radius: 0;
    padding-left: 1.25rem;
    background: transparent;
}

.alias-input-wrapper:focus-within {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.badge {
    background: rgba(168, 85, 247, 0.15);
    color: var(--accent-purple);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.alias-error-badge {
    display: none;
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-danger);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
    border: 1px solid rgba(244, 63, 94, 0.25);
    text-transform: none;
}

.help-text {
    font-size: 0.775rem;
    color: var(--text-muted);
    line-height: 1.4;
}

code {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-family: monospace;
    color: var(--accent-purple);
}

/* ----------------------------------------------------
   BUTTON STYLES
   ---------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-indigo) 0%, var(--accent-purple) 100%);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.45);
}

.primary-btn:active {
    transform: translateY(1px);
}

/* Button Loading State */
.btn-loader {
    width: 20px;
    height: 20px;
    animation: rotate-loader 2s linear infinite;
    display: none;
    position: absolute;
}

.btn-loader .path {
    stroke: #ffffff;
    stroke-linecap: round;
    animation: dash-loader 1.5s ease-in-out infinite;
}

@keyframes rotate-loader {
    100% { transform: rotate(360deg); }
}

@keyframes dash-loader {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

.btn.loading {
    color: transparent;
    pointer-events: none;
}

.btn.loading .btn-loader {
    display: block;
}

/* ----------------------------------------------------
   RESULT CARD STYLES
   ---------------------------------------------------- */
.result-card {
    border-color: rgba(16, 185, 129, 0.2);
    animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.success-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.success-icon-wrapper {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-icon {
    width: 20px;
    height: 20px;
}

.success-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.result-display {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.result-url-container {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

#resultUrl {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--accent-teal);
    font-weight: 600;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    outline: none;
    font-size: 1.05rem;
    cursor: default;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    padding: 0 1.5rem;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.copy-icon {
    width: 18px;
    height: 18px;
}

.original-link-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    gap: 0.5rem;
    overflow: hidden;
}

.preview-label {
    font-weight: 600;
    color: var(--text-muted);
}

#resultOriginalUrl {
    color: var(--accent-indigo);
    text-decoration: none;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    transition: var(--transition-fast);
}

#resultOriginalUrl:hover {
    text-decoration: underline;
    color: #818cf8;
}

.hidden {
    display: none !important;
}

/* ----------------------------------------------------
   HISTORY DASHBOARD STYLES
   ---------------------------------------------------- */
.history-header {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 600px) {
    .history-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.title-with-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.count-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    padding: 0.15rem 0.6rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 700;
}

.history-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

@media (min-width: 600px) {
    .history-actions {
        width: auto;
    }
}

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

.search-icon {
    position: absolute;
    left: 1rem;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

#historySearch {
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    font-size: 0.9rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
}

#historySearch:focus {
    background: rgba(255, 255, 255, 0.04);
}

.text-btn {
    background: transparent;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-radius: 8px;
}

.text-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.text-btn.danger-hover:hover {
    background: rgba(244, 63, 94, 0.1);
    color: var(--accent-danger);
}

/* History List & Items */
.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    text-align: center;
    gap: 1rem;
}

.empty-icon {
    width: 48px;
    height: 48px;
    color: rgba(255, 255, 255, 0.1);
}

.history-list-wrapper {
    max-height: 480px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

/* Custom Scrollbar */
.history-list-wrapper::-webkit-scrollbar {
    width: 6px;
}

.history-list-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.history-list-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.history-list-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

@media (min-width: 600px) {
    .history-item {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
    transform: translateX(3px);
}

.history-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--accent-indigo), var(--accent-purple));
    opacity: 0;
    transition: var(--transition-fast);
}

.history-item:hover::before {
    opacity: 1;
}

.item-left {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0; /* Ensures text-overflow ellipsis works */
    flex-grow: 1;
}

.item-notes-display {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #d1d5db;
    margin: 0.25rem 0;
    max-width: max-content;
    word-break: break-all;
    gap: 0.25rem;
}

.item-short-link {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-teal);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.item-short-link:hover {
    text-decoration: underline;
}

.item-long-link {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 90%;
}

.item-long-link:hover {
    color: var(--text-primary);
}

.item-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.item-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;
}

@media (min-width: 600px) {
    .item-right {
        justify-content: flex-end;
    }
}

.clicks-badge {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.15);
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.825rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.clicks-icon {
    width: 14px;
    height: 14px;
}

.action-btns {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.icon-btn.delete-btn:hover {
    background: rgba(244, 63, 94, 0.1);
    color: var(--accent-danger);
    border-color: rgba(244, 63, 94, 0.1);
}

.icon-btn svg {
    width: 16px;
    height: 16px;
}

/* ----------------------------------------------------
   FOOTER
   ---------------------------------------------------- */
footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 1rem 0;
}

/* ----------------------------------------------------
   TOAST NOTIFICATIONS
   ---------------------------------------------------- */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: rgba(13, 17, 30, 0.9);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 280px;
    max-width: 400px;
    pointer-events: auto;
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: var(--transition-smooth);
}

.toast-success {
    border-left: 4px solid var(--accent-success);
}

.toast-error {
    border-left: 4px solid var(--accent-danger);
}

.toast-icon {
    width: 20px;
    height: 20px;
}

.toast-success .toast-icon {
    color: var(--accent-success);
}

.toast-error .toast-icon {
    color: var(--accent-danger);
}

.toast-message {
    font-size: 0.9rem;
    font-weight: 500;
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast.fade-out {
    animation: toastOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ----------------------------------------------------
   KEYFRAMES KEY VISUALS
   ---------------------------------------------------- */
@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(15px) scale(0.9);
    }
}

/* ----------------------------------------------------
   MATH CAPTCHA STYLING
   ---------------------------------------------------- */
.captcha-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

.captcha-question-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.5rem 0.85rem;
    border-radius: 12px;
    height: 44px;
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.captcha-question {
    font-weight: 700;
    color: var(--accent-teal);
    font-family: monospace;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    text-shadow: 0 0 8px rgba(20, 184, 166, 0.35);
    white-space: nowrap;
}

.captcha-equals {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 1.1rem;
}

input[type="text"].captcha-input-compact {
    flex: 1 !important;
    width: 0 !important;
    min-width: 0 !important;
    height: 44px !important;
    padding: 0 1rem !important;
    text-align: left !important;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    transition: var(--transition-smooth);
}

input[type="text"].captcha-input-compact:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.refresh-captcha-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    padding: 0;
    flex-shrink: 0;
}

.refresh-captcha-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--accent-indigo);
    transform: rotate(180deg);
}

.refresh-icon {
    width: 16px;
    height: 16px;
}

/* ----------------------------------------------------
   VALIDATION ERROR STYLING & SHAKE ANIMATION
   ---------------------------------------------------- */
.input-error,
.alias-input-wrapper.input-error {
    border-color: var(--accent-danger) !important;
    box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.2) !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
    20%, 40%, 60%, 80% { transform: translateX(6px); }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

/* ----------------------------------------------------
   MOBILE RESPONSIVE OVERRIDES (Anti-Overflow & Center Symmetry)
   ---------------------------------------------------- */
@media (max-width: 600px) {
    .tab-btn {
        padding: 0.75rem 0.5rem !important;
        font-size: 0.8rem !important;
        gap: 0.4rem !important;
    }
    .nav-tab {
        padding: 0.3rem 0.6rem !important;
        font-size: 0.75rem !important;
    }
    .logo-title {
        font-size: 1.6rem !important;
    }
}

/* ----------------------------------------------------
   LOADING OVERLAY & PROGRESS BAR
   ---------------------------------------------------- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(7, 9, 19, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.loading-card {
    background: rgba(13, 17, 30, 0.9);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2.25rem;
    width: 90%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 25px 55px rgba(0, 0, 0, 0.55);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.loading-overlay.active .loading-card {
    transform: scale(1);
}

.loading-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.progress-bar-container {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    height: 10px;
    width: 100%;
    overflow: hidden;
    margin-bottom: 1.15rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, var(--accent-indigo) 0%, var(--accent-purple) 100%);
    box-shadow: 0 0 10px var(--glow-indigo);
    border-radius: 99px;
    transition: width 0.1s ease-out;
}

.loading-status {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* ----------------------------------------------------
   PANRB DIGITAL SERVICE SURVEY POPUP MODAL
   ---------------------------------------------------- */
.panrb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 8, 18, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.panrb-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.panrb-modal-card {
    background: linear-gradient(145deg, rgba(17, 24, 39, 0.95), rgba(15, 23, 42, 0.98));
    border: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(245, 158, 11, 0.15);
    border-radius: 24px;
    width: 100%;
    max-width: 560px;
    padding: 1.75rem 2rem;
    position: relative;
    color: #f8fafc;
    transform: translateY(20px) scale(0.96);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(245, 158, 11, 0.4) transparent;
}

/* Sleek custom scrollbar for modal card */
.panrb-modal-card::-webkit-scrollbar {
    width: 6px;
}

.panrb-modal-card::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 99px;
    margin: 12px 0;
}

.panrb-modal-card::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.5), rgba(217, 119, 6, 0.5));
    border-radius: 99px;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.3);
    transition: background 0.2s ease;
}

.panrb-modal-card::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #f59e0b, #d97706);
}

.panrb-modal-overlay.active .panrb-modal-card {
    transform: translateY(0) scale(1);
}

.panrb-modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.panrb-modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
}

.panrb-modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.panrb-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.25));
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
    padding: 0.35rem 0.85rem;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.panrb-modal-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 0.4rem 0;
    letter-spacing: -0.4px;
}

.panrb-modal-subtitle {
    font-size: 0.84rem;
    color: #94a3b8;
    line-height: 1.45;
    margin: 0;
}

.panrb-form-group {
    margin-bottom: 1.25rem;
}

.panrb-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 0.5rem;
}

/* Category Pills */
.panrb-category-pills {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
}

.panrb-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 0.5rem 0.25rem;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.panrb-pill input {
    display: none;
}

.panrb-pill:hover {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.panrb-pill.active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.35));
    border-color: #f59e0b;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

/* Overall Rating Section */
.panrb-rating-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
}

.panrb-star-rating {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    font-size: 2.2rem;
    margin: 0.3rem 0;
    cursor: pointer;
}

.panrb-star {
    color: #475569;
    transition: color 0.15s ease, transform 0.15s ease;
    user-select: none;
}

.panrb-star:hover,
.panrb-star.active {
    color: #fbbf24;
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
}

.panrb-star:hover {
    transform: scale(1.2);
}

.panrb-rating-text {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fbbf24;
    margin-top: 0.25rem;
}

/* Aspects Grid */
.panrb-aspects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 0.75rem;
}

@media (max-width: 540px) {
    .panrb-aspects-grid {
        grid-template-columns: 1fr;
    }
}

.panrb-aspect-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 0.75rem 0.85rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.panrb-aspect-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #e2e8f0;
}

.panrb-aspect-desc {
    display: block;
    font-size: 0.7rem;
    color: #94a3b8;
    margin-bottom: 0.4rem;
}

.panrb-mini-stars {
    display: flex;
    gap: 0.25rem;
    font-size: 1.15rem;
    cursor: pointer;
}

.panrb-mstar {
    color: #334155;
    transition: color 0.15s ease;
}

.panrb-mstar.active {
    color: #fbbf24;
}

/* Textarea & Buttons */
.panrb-textarea {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #f8fafc;
    padding: 0.75rem 0.9rem;
    font-family: inherit;
    font-size: 0.85rem;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.panrb-textarea:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.panrb-modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.panrb-btn-primary {
    flex: 2;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    border: none;
    padding: 0.85rem 1.25rem;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 8px 20px rgba(217, 119, 6, 0.35);
    transition: all 0.2s ease;
}

.panrb-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(217, 119, 6, 0.5);
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
}

.panrb-btn-secondary {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.panrb-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* Success View */
.panrb-success-view {
    text-align: center;
    padding: 1.5rem 0;
}

.panrb-success-badge {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.panrb-success-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 0.5rem 0;
}

.panrb-success-desc {
    font-size: 0.88rem;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0 0 1.5rem 0;
}

