/* ==========================================================================
   Design System & Styles inspired by alejandrolarracilla.com/cv/
   Palette Tokens:
   - Primary: #000000 (Black background)
   - Secondary: #4A7470 (Slate Teal)
   - Accent: #008749 (Emerald Green)
   - Accent Light / Highlight: #7CE5C6 (Mint Cyan)
   - White: #FFFFFF
   - Typography: 'Open Sans', Sans-serif
   ========================================================================== */

:root {
    --color-primary: #000000;
    --color-secondary: #4A7470;
    --color-accent: #008749;
    --color-accent-light: #7CE5C6;
    --color-white: #FFFFFF;
    --color-text-muted: #abb8c3;
    
    /* Dark Surface Colors */
    --color-bg-base: #000000;
    --color-surface-card: #0c1214;
    --color-surface-inner: #070b0c;
    --color-surface-hover: #141d20;
    --color-border-subtle: rgba(74, 116, 112, 0.3);
    --color-border-active: #7CE5C6;
    
    /* Security Strength Palette */
    --color-weak: #e74c3c;
    --color-weak-bg: rgba(231, 76, 60, 0.15);
    --color-weak-border: rgba(231, 76, 60, 0.35);
    
    --color-medium: #fcb900;
    --color-medium-bg: rgba(252, 185, 0, 0.15);
    --color-medium-border: rgba(252, 185, 0, 0.35);
    
    --color-strong: #7CE5C6;
    --color-strong-alt: #00d084;
    --color-strong-bg: rgba(124, 229, 198, 0.15);
    --color-strong-border: rgba(124, 229, 198, 0.35);

    /* Fonts */
    --font-main: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    color-scheme: dark;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg-base);
    color: var(--color-white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Subtle background ambient lighting */
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(0, 135, 73, 0.14) 0%, transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(74, 116, 112, 0.16) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(124, 229, 198, 0.04) 0%, transparent 60%);
    background-attachment: fixed;
}

/* Page Layout */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 30px 20px 0;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

/* Header Styles */
.app-header {
    text-align: center;
    margin-bottom: 24px;
}

.header-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--color-accent-light);
    background: rgba(124, 229, 198, 0.1);
    border: 1px solid rgba(124, 229, 198, 0.25);
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.main-title {
    font-family: var(--font-main);
    font-size: 1.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-white);
    margin-bottom: 12px;
}

.title-divider {
    width: 70px;
    height: 2px;
    background: linear-gradient(90deg, var(--color-secondary), var(--color-accent), var(--color-accent-light));
    margin: 0 auto 14px;
    border-radius: 2px;
}

.subtitle {
    font-size: 0.92rem;
    color: var(--color-text-muted);
    font-weight: 400;
    max-width: 440px;
    margin: 0 auto;
}

/* Main Container Card (inspired by Elementor section with left accent border) */
.container {
    background: var(--color-surface-card);
    border: 1px solid var(--color-border-subtle);
    border-left: 4px solid var(--color-accent);
    border-radius: 12px;
    padding: 32px 28px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(0, 135, 73, 0.08);
    backdrop-filter: blur(8px);
    margin-bottom: 36px;
    transition: border-color 0.3s ease;
}

/* Result Box / Password Display */
.result-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-surface-inner);
    border: 1px solid var(--color-secondary);
    border-radius: 10px;
    padding: 8px 10px 8px 16px;
    margin-bottom: 22px;
    transition: all 0.3s ease;
}

.result-box:focus-within {
    border-color: var(--color-accent-light);
    box-shadow: 0 0 0 3px rgba(124, 229, 198, 0.18);
}

#password {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--color-accent-light);
    font-family: var(--font-mono);
    font-size: 1.22rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    width: 100%;
    text-overflow: ellipsis;
}

#password::placeholder {
    color: rgba(171, 184, 195, 0.4);
    font-family: var(--font-main);
    font-size: 1rem;
    letter-spacing: normal;
    font-weight: 400;
}

.result-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Icon Buttons (Refresh, Copy) */
.icon-btn {
    background: var(--color-secondary);
    color: var(--color-white);
    border: none;
    border-radius: 8px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    flex-shrink: 0;
}

.icon-btn:hover {
    background: var(--color-accent-light);
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(124, 229, 198, 0.35);
}

.icon-btn:active {
    transform: translateY(0);
}

.icon-btn svg {
    transition: transform 0.3s ease;
}

#refreshBtn:hover svg {
    transform: rotate(90deg);
}

/* Copy button check state */
.copy-btn .check-icon {
    display: none;
}

.copy-btn.copied {
    background: var(--color-accent) !important;
    color: var(--color-white) !important;
}

.copy-btn.copied .copy-icon {
    display: none;
}

.copy-btn.copied .check-icon {
    display: block;
}

/* Strength Meter Card */
.strength-card {
    background: var(--color-surface-inner);
    border: 1px solid rgba(74, 116, 112, 0.25);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 24px;
}

.strength-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.strength-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

/* Strength Text Badges */
.strength-text {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 6px;
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.35s ease;
}

/* Weak State */
.strength-text.weak,
.strength-text.debil {
    color: var(--color-weak);
    background: var(--color-weak-bg);
    border-color: var(--color-weak-border);
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.2);
}

/* Medium State */
.strength-text.medium,
.strength-text.mediana {
    color: var(--color-medium);
    background: var(--color-medium-bg);
    border-color: var(--color-medium-border);
    box-shadow: 0 0 10px rgba(252, 185, 0, 0.2);
}

/* Strong State */
.strength-text.strong,
.strength-text.fuerte {
    color: var(--color-strong);
    background: var(--color-strong-bg);
    border-color: var(--color-strong-border);
    box-shadow: 0 0 12px rgba(124, 229, 198, 0.25);
}

/* Strength Track & Animated Bar */
.strength-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin-bottom: 10px;
}

.strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease, box-shadow 0.4s ease;
}

/* Strength Bar Colors - Supporting both English and Spanish classes */
.strength-bar.weak,
.strength-bar.debil {
    width: 33.33%;
    background-color: var(--color-weak);
    box-shadow: 0 0 12px rgba(231, 76, 60, 0.6);
}

.strength-bar.medium,
.strength-bar.mediana {
    width: 66.66%;
    background-color: var(--color-medium);
    box-shadow: 0 0 12px rgba(252, 185, 0, 0.6);
}

.strength-bar.strong,
.strength-bar.fuerte {
    width: 100%;
    background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
    box-shadow: 0 0 14px rgba(124, 229, 198, 0.7);
}

.strength-hint {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    line-height: 1.4;
    transition: color 0.3s ease;
}

/* Settings Section */
.settings {
    margin-bottom: 26px;
}

.setting-group-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--color-accent-light);
    margin: 22px 0 12px 0;
    text-transform: uppercase;
}

/* Length Block */
.setting-block.length-block {
    background: var(--color-surface-inner);
    border: 1px solid rgba(74, 116, 112, 0.25);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 14px;
}

.setting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.setting-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-white);
}

.length-value-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

#length {
    width: 58px;
    background: var(--color-surface-card);
    border: 1px solid var(--color-secondary);
    border-radius: 6px;
    color: var(--color-accent-light);
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    padding: 5px 6px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#length:focus {
    border-color: var(--color-accent-light);
    box-shadow: 0 0 0 2px rgba(124, 229, 198, 0.2);
}

/* Hide spin buttons in input number for sleek look */
#length::-webkit-inner-spin-button,
#length::-webkit-outer-spin-button {
    opacity: 0.7;
}

.length-unit {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Range Slider */
.slider-wrapper {
    width: 100%;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    transition: background 0.2s;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-accent-light);
    border: 2px solid var(--color-surface-card);
    box-shadow: 0 0 10px rgba(124, 229, 198, 0.7);
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--color-white);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-accent-light);
    border: 2px solid var(--color-surface-card);
    box-shadow: 0 0 10px rgba(124, 229, 198, 0.7);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.range-limits {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.72rem;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
}

/* Option Items (Checkboxes with Toggles) */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-surface-inner);
    border: 1px solid rgba(74, 116, 112, 0.2);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.setting-item:hover {
    background: var(--color-surface-hover);
    border-color: rgba(74, 116, 112, 0.4);
}

.setting-info {
    display: flex;
    flex-direction: column;
}

.setting-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-white);
}

.setting-desc {
    font-size: 0.76rem;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    margin-top: 2px;
}

/* Modern Toggle Switch */
.toggle-container {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-container input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    transition: 0.3s;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: var(--color-white);
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

.toggle-container input:checked + .toggle-slider {
    background-color: var(--color-accent);
    border-color: var(--color-accent-light);
}

.toggle-container input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background-color: var(--color-accent-light);
    box-shadow: 0 0 8px rgba(124, 229, 198, 0.6);
}

/* Generate Button (Directly inspired by Elementor button styles in Kit-9) */
.generate-btn {
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-radius: 10px;
    background-color: var(--color-secondary);
    color: var(--color-white);
    font-family: var(--font-main);
    font-size: 0.98rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.generate-btn:hover {
    background-color: var(--color-accent-light);
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(124, 229, 198, 0.4);
}

.generate-btn:active {
    transform: translateY(0);
}

/* Footer (Matching post-97.css and site layout) */
.site-footer {
    margin-top: auto;
    width: 100%;
    border-top: 1px solid var(--color-secondary);
    padding: 24px 0 32px;
    text-align: center;
}

.footer-container {
    max-width: 600px;
    margin: 0 auto;
}

.footer-link {
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-secondary);
    text-decoration: none;
    letter-spacing: 0.5px;
    padding: 6px 14px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-link:hover {
    color: var(--color-accent-light);
    text-shadow: 0 0 10px rgba(124, 229, 198, 0.6);
    background: rgba(124, 229, 198, 0.08);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(90px);
    background: #0d1719;
    border: 1px solid var(--color-accent-light);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(124, 229, 198, 0.25);
    color: var(--color-white);
    padding: 12px 22px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    pointer-events: none;
    z-index: 999;
}

.toast svg {
    color: var(--color-accent-light);
    flex-shrink: 0;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    .page-wrapper {
        padding: 20px 14px 0;
    }
    
    .container {
        padding: 24px 18px;
    }
    
    .main-title {
        font-size: 1.55rem;
    }
    
    #password {
        font-size: 1.05rem;
    }
    
    .icon-btn {
        width: 38px;
        height: 38px;
    }
}

/* ==========================================================================
   Contador de Visitas Únicas
   ========================================================================== */
.visitor-counter {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 24px auto 32px;
    width: 100%;
}

.counter-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: rgba(12, 18, 20, 0.85);
    border: 1px solid rgba(74, 116, 112, 0.35);
    padding: 7px 16px;
    border-radius: 30px;
    font-size: 0.82rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    transition: all 0.25s ease;
}

.counter-badge:hover {
    border-color: var(--color-border-active, #7CE5C6);
    box-shadow: 0 6px 20px rgba(124, 229, 198, 0.15);
}

.counter-dot {
    width: 7px;
    height: 7px;
    background-color: var(--color-accent-light, #7CE5C6);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--color-accent-light, #7CE5C6);
    animation: counterPulse 2.2s infinite ease-in-out;
}

@keyframes counterPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.85); }
}

.counter-icon {
    color: var(--color-secondary, #4A7470);
}

.counter-label {
    font-weight: 500;
    color: var(--color-text-muted, #abb8c3);
    letter-spacing: 0.3px;
}

.counter-number {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--color-white, #FFFFFF);
    background: rgba(124, 229, 198, 0.12);
    border: 1px solid rgba(124, 229, 198, 0.25);
    padding: 1px 7px;
    border-radius: 6px;
    min-width: 28px;
    text-align: center;
}
