/* CSS Reset and Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #e0e7ff;
    --success-color: #10b981;
    --success-bg: #d1fae5;
    --danger-color: #ef4444;
    --danger-bg: #fee2e2;
    --warning-color: #f59e0b;
    --warning-bg: #fef3c7;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.shield-icon {
    width: 48px;
    height: 48px;
    color: white;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tagline {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.125rem;
}

/* Main Content */
main {
    flex: 1;
}

/* Input Section */
.input-section {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.input-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

#passwordInput {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

#passwordInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

#passwordInput::placeholder {
    color: var(--text-light);
}

.toggle-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-secondary);
    transition: color 0.2s;
}

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

.toggle-btn svg {
    width: 20px;
    height: 20px;
}

.check-btn {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.check-btn:hover:not(:disabled) {
    background: var(--primary-hover);
}

.check-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.check-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

.hidden {
    display: none !important;
}

/* Results Section */
.results-section {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-safe {
    text-align: center;
}

.result-safe .result-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    color: var(--success-color);
}

.result-safe h3 {
    color: var(--success-color);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.result-safe p {
    color: var(--text-secondary);
}

.result-compromised {
    text-align: center;
}

.result-compromised .result-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    color: var(--danger-color);
}

.result-compromised h3 {
    color: var(--danger-color);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.result-compromised .breach-count {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--danger-color);
    margin: 1rem 0;
}

.result-compromised .breach-label {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.advisory-box {
    background: var(--danger-bg);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: left;
    margin-top: 1.5rem;
}

.advisory-box h4 {
    color: var(--danger-color);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.advisory-box h4 svg {
    width: 20px;
    height: 20px;
}

.advisory-box ul {
    list-style: none;
    padding: 0;
}

.advisory-box li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-primary);
}

.advisory-box li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--danger-color);
    font-weight: bold;
}

.result-error {
    text-align: center;
}

.result-error .result-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    color: var(--warning-color);
}

.result-error h3 {
    color: var(--warning-color);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.result-error p {
    color: var(--text-secondary);
}

/* Info Section */
.info-section {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.info-section h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.info-card {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    transition: transform 0.2s, box-shadow 0.2s;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--primary-color);
}

.card-icon svg {
    width: 100%;
    height: 100%;
}

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

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

/* Security Tips */
.security-tips {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.security-tips h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.security-tips ul {
    list-style: none;
    max-width: 500px;
    margin: 0 auto;
}

.security-tips li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.security-tips li:last-child {
    border-bottom: none;
}

.security-tips li svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--success-color);
}

/* Footer */
footer {
    margin-top: auto;
    padding-top: 2rem;
}

.footer-content {
    text-align: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

.powered-by {
    color: white;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.powered-by a {
    color: white;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.powered-by a:hover {
    text-decoration-thickness: 2px;
}

.disclaimer {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.disclaimer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .shield-icon {
        width: 36px;
        height: 36px;
    }

    .tagline {
        font-size: 1rem;
    }

    .input-section,
    .info-section,
    .security-tips,
    .results-section {
        padding: 1.5rem;
    }

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

    .result-compromised .breach-count {
        font-size: 2rem;
    }
}

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

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-light: #9ca3af;
        --bg-primary: #1f2937;
        --bg-secondary: #374151;
        --bg-tertiary: #4b5563;
        --border-color: #4b5563;
        --danger-bg: #450a0a;
        --success-bg: #052e16;
        --warning-bg: #451a03;
    }

    body {
        background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    }

    #passwordInput {
        background: var(--bg-secondary);
        color: var(--text-primary);
    }

    .advisory-box {
        background: var(--danger-bg);
    }

    .advisory-box li {
        color: var(--text-secondary);
    }
}
