/* CSS Reset & Variables */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border: #475569;
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s ease;
}

/* Accessibility: Respect user preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
header {
    background: rgba(15, 23, 42, 0.98);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-light);
}

nav {
    display: flex;
    gap: 2rem;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--primary-light);
}

/* Main Layout */
main {
    padding: 2rem;
    width: 100%;
}

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 2rem;
    width: 100%;
}

.content-center {
    max-width: 900px;
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 2rem 0 3rem;
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Generator Card */
.generator-section {
    margin-bottom: 3rem;
    width: 100%;
}

.generator-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    width: 100%;
}

/* Password Display */
.password-display {
    display: flex;
    gap: 12px;
    margin-bottom: 1rem;
}

.password-display input {
    flex: 1;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    font-size: 1.25rem;
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
    letter-spacing: 2px;
}

.password-display input:focus {
    outline: none;
    border-color: var(--primary);
}

.copy-btn {
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0 1.25rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Strength Meter */
.strength-meter {
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

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

.strength-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Options */
.options {
    margin-bottom: 1.5rem;
}

.option-group {
    margin-bottom: 1.5rem;
}

.option-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.option-group input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: var(--bg-input);
    border-radius: 4px;
    cursor: pointer;
    border: none;
}

.option-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
    border: none;
}

.option-group input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
    border: none;
}

.option-group input[type="range"]::-moz-range-track {
    background: var(--bg-input);
    height: 8px;
    border-radius: 4px;
}

.option-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.option-group input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.1);
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    transition: background 0.3s;
}

.checkbox-label:hover {
    background: var(--border);
}

.checkbox-label input {
    display: none;
}

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

.checkbox-label input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label input:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.exclude-group {
    margin-bottom: 1.5rem;
}

.exclude-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.exclude-group input {
    width: 100%;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--text-primary);
}

.exclude-group input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Buttons */
.generate-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-sm);
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.5);
}

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

.bulk-generate {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.bulk-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.bulk-input {
    width: 80px;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    text-align: center;
}

.bulk-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Hide default spinner and use custom styling */
.bulk-input::-webkit-inner-spin-button,
.bulk-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.bulk-input {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Custom number input wrapper */
.number-input-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.number-input-wrapper .bulk-input {
    padding-right: 2.5rem;
}

.number-controls {
    position: absolute;
    right: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.number-controls button {
    background: var(--primary);
    border: none;
    color: white;
    width: 24px;
    height: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: background 0.2s;
    border-radius: 4px;
}

.number-controls button:hover {
    background: var(--primary-light);
}

.number-controls button:active {
    background: var(--primary-dark);
}

.bulk-btn {
    width: 100%;
    background: transparent;
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s;
}

.bulk-btn:hover {
    background: var(--primary);
    color: white;
}

.bulk-passwords {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bulk-password-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-input);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.bulk-password-item button {
    background: transparent;
    border: none;
    color: var(--primary-light);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.bulk-password-item button:hover {
    color: var(--primary);
}

/* Ad Containers */
.ad-container {
    text-align: center;
}

.ad-placeholder {
    background: linear-gradient(135deg, #1e293b, #334155);
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.ad-banner-top,
.ad-banner-bottom {
    padding: 1rem 2rem;
}

.ad-banner-top .ad-placeholder,
.ad-banner-bottom .ad-placeholder {
    max-width: 728px;
    height: 90px;
    margin: 0 auto;
}

.ad-sidebar {
    position: sticky;
    top: 100px;
    flex-shrink: 0;
    display: none;
}

@media (min-width: 1200px) {
    .ad-sidebar {
        display: block;
    }
}

.ad-vertical {
    width: 160px;
    height: 600px;
}

.ad-in-content .ad-placeholder {
    height: 250px;
    max-width: 100%;
    margin: 2rem 0;
}

/* Tips Section */
.tips-section {
    padding: 3rem 0;
    width: 100%;
}

.tips-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    width: 100%;
}

.tip-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    transition: transform 0.3s, box-shadow 0.3s;
    width: 100%;
    min-width: 0;
}

.tip-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.tip-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.tip-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--primary-light);
}

.tip-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* FAQ Section */
.faq-section {
    padding: 3rem 0;
    width: 100%;
}

.faq-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.faq-list {
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}

.faq-item {
    margin-bottom: 1rem;
    width: 100%;
}

.faq-question {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.faq-question:hover {
    background: var(--bg-input);
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--primary);
    transition: transform 0.3s;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 200px;
}

.faq-answer p {
    padding: 1.25rem;
    color: var(--text-secondary);
    background: var(--bg-input);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    border: 1px solid var(--border);
    border-top: none;
}

/* Footer */
footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 3rem 2rem 1rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.footer-section h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--primary-light);
}

.footer-section p {
    color: var(--text-secondary);
}

.footer-section a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--secondary);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

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

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
        align-items: center;
    }

    .ad-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    nav {
        gap: 1rem;
    }

    .hero h2 {
        font-size: 1.75rem;
    }

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

    .tips-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .ad-banner-top .ad-placeholder,
    .ad-banner-bottom .ad-placeholder {
        height: 100px;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.generating .generate-btn svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Legal Pages Styles */
.legal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 3rem;
    border: 1px solid var(--border);
    margin: 2rem 0;
}

.legal-content h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.legal-content .last-updated {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.legal-section {
    margin-bottom: 2rem;
}

.legal-section h3 {
    font-size: 1.25rem;
    color: var(--primary-light);
    margin-bottom: 0.75rem;
}

.legal-section h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 1rem 0 0.5rem;
}

.legal-section p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.legal-section ul {
    color: var(--text-secondary);
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.legal-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.legal-section a {
    color: var(--primary-light);
    text-decoration: none;
}

.legal-section a:hover {
    text-decoration: underline;
}
