/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #00ff88;
    --primary-dark: #00cc6a;
    --secondary: #ff3333;
    --accent: #00d4ff;
    --bg-dark: #0a0a0f;
    --bg-card: #111118;
    --bg-card-hover: #1a1a24;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    --border: #2a2a3a;
    --glow-primary: 0 0 20px rgba(0, 255, 136, 0.3);
    --glow-accent: 0 0 20px rgba(0, 212, 255, 0.3);
    --glow-red: 0 0 20px rgba(255, 51, 51, 0.4);
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
}

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===== MAIN CONTAINER ===== */
.main-container {
    position: relative;
    min-height: 100vh;
    z-index: 1;
}

/* ===== BACKGROUND CANVAS ===== */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===== HEADER ===== */
.main-header {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 50px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.9), transparent);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 3D Logo */
.logo-3d {
    width: 60px;
    height: 60px;
    position: relative;
    transform-style: preserve-3d;
    animation: logoRotate 8s linear infinite;
}

@keyframes logoRotate {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

.logo-face {
    position: absolute;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--primary);
    border: 2px solid var(--primary);
    background: rgba(0, 255, 136, 0.1);
    text-shadow: 0 0 10px var(--primary);
    backface-visibility: visible;
}

.logo-face.front { transform: translateZ(30px); }
.logo-face.back { transform: rotateY(180deg) translateZ(30px); }
.logo-face.right { transform: rotateY(90deg) translateZ(30px); }
.logo-face.left { transform: rotateY(-90deg) translateZ(30px); }
.logo-face.top { transform: rotateX(90deg) translateZ(30px); }
.logo-face.bottom { transform: rotateX(-90deg) translateZ(30px); }

.logo-text h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--primary);
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
    letter-spacing: 3px;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border: 1px solid var(--primary);
    border-radius: 30px;
    background: rgba(0, 255, 136, 0.05);
    animation: badgeGlow 3s ease-in-out infinite;
}

@keyframes badgeGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 255, 136, 0.2); }
    50% { box-shadow: 0 0 25px rgba(0, 255, 136, 0.4); }
}

.badge-icon {
    font-size: 1.2rem;
}

.badge-text {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--primary);
    letter-spacing: 2px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

/* ===== CARDS ===== */
.generator-card,
.history-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.generator-card:hover,
.history-card:hover {
    border-color: var(--primary);
    box-shadow: var(--glow-primary);
}

.generator-card::before,
.history-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.card-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 10px;
    border: 1px solid var(--primary);
}

.card-header h2 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--text-primary);
    flex: 1;
}

/* ===== PASSWORD DISPLAY ===== */
.password-display-container {
    margin-bottom: 25px;
}

.password-display {
    background: linear-gradient(135deg, #0d0d15, #151520);
    border: 2px solid var(--border);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.password-display:hover {
    border-color: var(--primary);
}

.password-display::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.05), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.password-text {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--primary);
    letter-spacing: 3px;
    word-break: break-all;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
    display: block;
    min-height: 40px;
}

.password-strength {
    margin-top: 15px;
    height: 6px;
    background: var(--bg-dark);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: all 0.5s ease;
    position: relative;
}

.strength-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
    animation: strengthGlow 1s ease-in-out infinite;
}

@keyframes strengthGlow {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.strength-weak { background: linear-gradient(90deg, #ff3333, #ff6666); width: 25%; }
.strength-fair { background: linear-gradient(90deg, #ffaa00, #ffcc00); width: 50%; }
.strength-good { background: linear-gradient(90deg, #00aaff, #00ccff); width: 75%; }
.strength-strong { background: linear-gradient(90deg, #00ff88, #00ffaa); width: 100%; }

/* ===== PASSWORD ACTIONS ===== */
.password-actions {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.btn-copy,
.btn-refresh {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-copy:hover,
.btn-refresh:hover {
    border-color: var(--accent);
    background: rgba(0, 212, 255, 0.1);
    box-shadow: var(--glow-accent);
    transform: translateY(-2px);
}

.btn-copy svg,
.btn-refresh svg {
    width: 20px;
    height: 20px;
}

/* ===== OPTIONS ===== */
.options-container {
    margin-bottom: 25px;
}

.option-group {
    margin-bottom: 20px;
}

.option-label {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Length Slider */
.length-control {
    display: flex;
    align-items: center;
    gap: 20px;
}

.length-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    outline: none;
}

.length-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
    transition: all 0.3s ease;
}

.length-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.7);
}

.length-value {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--primary);
    min-width: 35px;
    text-align: center;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

/* Checkboxes */
.checkbox-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-dark);
}

.checkbox-item:hover {
    border-color: var(--primary);
    background: rgba(0, 255, 136, 0.05);
}

.checkbox-item input {
    display: none;
}

.checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--text-muted);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-item input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
}

.checkbox-item input:checked + .checkmark::after {
    content: '✓';
    color: var(--bg-dark);
    font-size: 14px;
    font-weight: bold;
}

.label-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.checkbox-item input:checked ~ .label-text {
    color: var(--primary);
}

/* ===== GENERATE BUTTON ===== */
.btn-generate {
    width: 100%;
    padding: 18px;
    border: 2px solid var(--primary);
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(0, 255, 136, 0.05));
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    letter-spacing: 3px;
}

.btn-generate:hover {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(0, 255, 136, 0.1));
    box-shadow: var(--glow-primary);
    transform: translateY(-3px);
}

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

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.2), transparent);
    animation: btnGlow 3s infinite;
}

@keyframes btnGlow {
    0% { left: -100%; }
    100% { left: 100%; }
}

.btn-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.btn-text svg {
    width: 24px;
    height: 24px;
}

/* ===== HISTORY ===== */
.history-card {
    grid-column: 2;
    grid-row: 1 / 3;
    max-height: 600px;
    display: flex;
    flex-direction: column;
}

.btn-clear {
    padding: 6px 15px;
    border: 1px solid var(--secondary);
    border-radius: 8px;
    background: rgba(255, 51, 51, 0.1);
    color: var(--secondary);
    font-family: var(--font-body);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-clear:hover {
    background: rgba(255, 51, 51, 0.2);
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.3);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.history-list::-webkit-scrollbar {
    width: 5px;
}

.history-list::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.history-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    font-style: italic;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
    background: var(--bg-dark);
    transition: all 0.3s ease;
    cursor: pointer;
}

.history-item:hover {
    border-color: var(--accent);
    background: rgba(0, 212, 255, 0.05);
    transform: translateX(5px);
}

.history-password {
    flex: 1;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text-primary);
    word-break: break-all;
}

.history-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.history-copy {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.history-copy:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 255, 136, 0.1);
}

.history-copy svg {
    width: 16px;
    height: 16px;
}

/* ===== INFO CARDS ===== */
.info-cards {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 20px;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.info-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: var(--glow-accent);
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.info-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.info-card h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.info-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== FOOTER ===== */
.main-footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 30px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.main-footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-highlight {
    color: var(--primary);
    font-weight: 600;
    animation: footerBlink 2s ease-in-out infinite;
}

@keyframes footerBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: 12px;
    box-shadow: var(--glow-primary);
    transform: translateX(150%);
    transition: transform 0.4s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border-radius: 50%;
    color: var(--bg-dark);
    font-weight: bold;
    font-size: 1rem;
}

.toast-message {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .history-card {
        grid-column: 1;
        grid-row: auto;
        max-height: 400px;
    }

    .info-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .logo-text h1 {
        font-size: 1.5rem;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .password-actions {
        flex-direction: column;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.generator-card,
.history-card,
.info-card {
    animation: fadeIn 0.6s ease forwards;
}

.generator-card { animation-delay: 0.1s; }
.history-card { animation-delay: 0.2s; }
.info-card:nth-child(1) { animation-delay: 0.3s; }
.info-card:nth-child(2) { animation-delay: 0.4s; }
.info-card:nth-child(3) { animation-delay: 0.5s; }
