/* ShieldPass - VOU! Brand Stylesheet */

/* Design Tokens & Theme Variables */
:root {
    --bg-base: hsl(215, 16%, 8%);            /* Deep Gunmetal Grey base background */
    --bg-surface: hsla(215, 12%, 15%, 0.88); /* Lighter gunmetal grey surface for card contrast */
    --bg-input: hsl(215, 16%, 10%);          /* Recessed darker input wells */
    --bg-input-hover: hsl(215, 14%, 13%);
    
    --border-color: hsla(215, 15%, 28%, 0.7);  /* Sharper, higher contrast borders */
    --border-color-hover: hsla(215, 15%, 42%, 0.95);
    --border-focus: hsl(217, 100%, 60%);
    
    --text-primary: hsl(210, 40%, 98%);
    --text-secondary: hsl(215, 20%, 80%);      /* Enhanced secondary text contrast */
    --text-muted: hsl(218, 12%, 60%);          /* Enhanced muted text contrast */

    --accent-gradient: linear-gradient(135deg, hsl(217, 100%, 55%) 0%, hsl(235, 100%, 63%) 100%);
    --accent-blue: hsl(217, 100%, 55%);
    --accent-orange: hsl(24, 100%, 50%);
    --accent-glow: hsla(217, 100%, 55%, 0.25);

    --strength-0: hsl(355, 85%, 55%); /* Weak */
    --strength-2: hsl(45, 90%, 50%);  /* Good */
    --strength-4: hsl(160, 85%, 40%); /* Strong */

    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
    
    /* Less rounding (minimalist) */
    --border-radius-lg: 12px;
    --border-radius-md: 6px;
    --border-radius-sm: 4px;
    
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --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 {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 16px 12px;
    font-size: 14px; /* Scaled down 20% from typical 16px base */
}

/* Background Glowing Orbs */
.background-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.14;
    mix-blend-mode: screen;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-blue) 0%, transparent 70%);
    top: -100px;
    right: -50px;
    animation: floatOrb1 15s infinite alternate ease-in-out;
}

.orb-2 {
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, var(--accent-orange) 0%, transparent 70%);
    bottom: -150px;
    left: -100px;
    animation: floatOrb2 20s infinite alternate ease-in-out;
}

@keyframes floatOrb1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-60px, 60px) scale(1.1); }
}

@keyframes floatOrb2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(80px, -45px) scale(0.9); }
}

/* App Container Layout (scaled down 20%) */
.app-container {
    width: 100%;
    max-width: 440px; /* 20% smaller than 580px */
    display: flex;
    flex-direction: column;
    gap: 20px; /* reduced from 32px */
}

/* Header */
.app-header {
    text-align: center;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 6px;
}

.logo-icon {
    font-size: 2rem;
    color: var(--accent-orange);
    filter: drop-shadow(0 0 8px hsla(24, 100%, 50%, 0.25));
}

#app-title {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: var(--accent-orange);
}

.subtitle {
    color: var(--text-secondary);
    font-size: clamp(0.55rem, 3vw, 0.8rem);
    font-weight: 500;
    line-height: 1.4;
    max-width: none;
    white-space: nowrap;
    margin: 0 auto;
}

/* Generator Card (scaled down 20%) */
.generator-card {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 22px; /* reduced from 32px */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 20px; /* reduced from 28px */
    position: relative;
    transition: border-color var(--transition-normal);
}

.generator-card:hover {
    border-color: var(--border-color-hover);
}

/* Password Display Panel */
.display-panel {
    display: flex;
    align-items: center;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 6px 6px 6px 18px; /* scaled down */
    transition: all var(--transition-normal);
    position: relative;
}

.display-panel:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.password-wrapper {
    flex: 1;
    overflow: hidden;
}

#password-display {
    width: 100%;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 8px 0;
    word-break: break-all;
    white-space: pre-wrap;
    min-height: 34px;
}

#password-display.placeholder-mode {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    font-weight: 500;
    letter-spacing: 0;
}

.action-buttons {
    display: flex;
    gap: 4px;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 36px; /* reduced from 46px */
    height: 36px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    position: relative;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background-color: var(--bg-input-hover);
    color: var(--text-primary);
}

.action-btn:active {
    transform: scale(0.95);
}

/* Tooltip */
.tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background-color: hsl(224, 70%, 15%);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px;
    border-style: solid;
    border-color: hsl(224, 70%, 15%) transparent transparent transparent;
}

.action-btn:hover .tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.action-btn.copied .tooltip {
    background-color: var(--strength-4);
    border-color: var(--strength-4);
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.action-btn.copied .tooltip::after {
    border-color: var(--strength-4) transparent transparent transparent;
}

/* Strength Meter */
.strength-meter-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.strength-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.strength-label-text {
    color: var(--text-muted);
}

.strength-text {
    transition: color var(--transition-normal);
}

.strength-bar-wrapper {
    height: 4px; /* reduced from 6px */
    background-color: var(--bg-input);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.strength-bar {
    height: 100%;
    width: 0%;
    background-color: var(--strength-0);
    border-radius: 2px;
    transition: width var(--transition-normal), background-color var(--transition-normal);
}

/* Configuration Panel */
.config-panel {
    display: flex;
    flex-direction: column;
    gap: 18px; /* reduced from 24px */
}

.config-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.range-label-text {
    font-size: 0.8rem; /* 20% smaller */
    font-weight: 700;
    color: var(--text-primary);
}

.length-counter {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-blue);
    background-color: var(--bg-input);
    padding: 2px 6px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.range-wrapper {
    display: flex;
    align-items: center;
    height: 28px; /* reduced from 36px */
}

/* Custom Styled Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px; /* reduced from 6px */
    border-radius: 2px;
    background: var(--bg-input);
    outline: none;
    transition: background var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px; /* reduced from 20px */
    height: 16px;
    border-radius: 50%;
    background: var(--text-primary);
    border: 2px solid var(--accent-blue);
    box-shadow: 0 0 8px var(--accent-glow);
    cursor: pointer;
    transition: transform var(--transition-fast), background var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    background: var(--accent-blue);
}

input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-primary);
    border: 2px solid var(--accent-blue);
    box-shadow: 0 0 8px var(--accent-glow);
    cursor: pointer;
    transition: transform var(--transition-fast), background var(--transition-fast);
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.15);
    background: var(--accent-blue);
}

/* Options Grid Layout */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* 3-column layout to fit scaled components */
    gap: 10px;
}

/* Custom Checkboxes */
.custom-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 10px 12px; /* reduced from 16px */
    border-radius: var(--border-radius-md);
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
}

.custom-checkbox-label:hover {
    background-color: var(--bg-input-hover);
    border-color: var(--border-color-hover);
}

.custom-checkbox-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.custom-checkbox {
    width: 16px; /* reduced from 22px */
    height: 16px;
    background-color: var(--bg-base);
    border: 1.5px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.custom-checkbox i {
    color: var(--bg-base);
    font-size: 0.6rem;
    transform: scale(0);
    transition: transform var(--transition-fast);
}

/* Checkbox Checked State */
.custom-checkbox-label input:checked ~ .custom-checkbox {
    background: var(--accent-gradient);
    border-color: transparent;
    box-shadow: 0 0 6px var(--accent-glow);
}

.custom-checkbox-label input:checked ~ .custom-checkbox i {
    color: var(--bg-base);
    transform: scale(1);
}

.custom-checkbox-label:has(input:checked) {
    border-color: hsla(217, 100%, 55%, 0.3);
    background-color: hsla(224, 60%, 12%, 0.5);
}

.label-content {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.option-title {
    font-size: 0.78rem; /* 20% smaller */
    font-weight: 700;
    color: var(--text-primary);
}

.option-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Symbols Section */
.symbols-section {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.symbols-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.dropdown-container {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dropdown-toggle-btn {
    width: 100%;
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dropdown-toggle-btn:hover {
    border-color: var(--border-color-hover);
    background-color: var(--bg-input-hover);
}

.dropdown-toggle-btn:focus {
    border-color: var(--accent-blue);
    outline: none;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background-color: hsl(224, 50%, 8%);
    border: 1px solid var(--border-color-hover);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    z-index: 100;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dropdown-menu.hidden {
    display: none;
}

.symbols-quick-actions {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
    margin-bottom: 4px;
}

.quick-action-btn {
    background: transparent;
    border: none;
    color: var(--accent-blue);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

.quick-action-btn:hover {
    text-decoration: underline;
}

.symbols-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
    max-height: 120px;
    overflow-y: auto;
}

.symbol-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
}

.symbol-item:hover {
    background-color: var(--bg-input-hover);
    border-color: var(--border-color-hover);
}

.symbol-item.selected {
    background: var(--accent-gradient);
    color: var(--bg-base);
    border-color: transparent;
    box-shadow: 0 0 4px var(--accent-glow);
}

.symbols-count-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Main Generate Button */
.generate-btn {
    background: var(--accent-gradient);
    border: none;
    color: var(--bg-base);
    font-family: var(--font-sans);
    font-size: 0.95rem; /* reduced from 1.05rem */
    font-weight: 800;
    letter-spacing: 0.02em;
    padding: 12px 18px; /* reduced from 18px 24px, less rounding */
    border-radius: var(--border-radius-md); /* changed to less rounding */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 18px var(--accent-glow);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.generate-btn span, .generate-btn i {
    position: relative;
    z-index: 2;
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, hsl(220, 100%, 62%) 0%, hsl(250, 100%, 72%) 100%);
    opacity: 0;
    z-index: 1;
    transition: opacity var(--transition-normal);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px hsla(217, 100%, 55%, 0.45);
}

.generate-btn:hover::before {
    opacity: 1;
}

.generate-btn:active {
    transform: translateY(1px);
    box-shadow: 0 4px 10px var(--accent-glow);
}

/* Footer Section */
.app-footer {
    display: flex;
    justify-content: center;
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: hsla(224, 71%, 7%, 0.4);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 50px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.security-badge-icon {
    color: var(--accent-orange);
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.shake-animation {
    animation: shake 0.4s ease-in-out;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    body {
        padding: 12px 8px;
    }
    
    .app-container {
        gap: 16px;
    }

    .generator-card {
        padding: 16px;
        gap: 16px;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    #password-display {
        font-size: 1.1rem;
    }

    #app-title {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: clamp(0.5rem, 3.2vw, 0.65rem);
    }
}

/* Session History Section Styles */
.history-card {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 16px 20px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color var(--transition-normal);
}

.history-card:hover {
    border-color: var(--border-color-hover);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 140px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Custom Scrollbar for history list */
.history-list::-webkit-scrollbar {
    width: 4px;
}
.history-list::-webkit-scrollbar-track {
    background: transparent;
}
.history-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}
.history-list::-webkit-scrollbar-thumb:hover {
    background: var(--border-color-hover);
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 6px 10px;
    transition: all var(--transition-fast);
}

.history-item:hover {
    border-color: var(--border-color-hover);
    background-color: var(--bg-input-hover);
}

.history-pwd-text {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-all;
    user-select: all;
    letter-spacing: 0.03em;
}

.history-copy-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 26px;
    height: 26px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all var(--transition-fast);
}

.history-copy-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-base);
}

.hidden {
    display: none !important;
}
