/* 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;
    --warning-color: #f59e0b;
    --warning-bg: #fef3c7;
    --danger-color: #ef4444;
    --danger-bg: #fee2e2;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
    --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;
}

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-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo {
    width: 48px;
    height: 48px;
}

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

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

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

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

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

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.password-wrapper {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.password-wrapper input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.password-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.toggle-btn {
    padding: 0.875rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.toggle-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.toggle-btn .hidden {
    display: none;
}

.check-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

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

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

.check-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

/* Security Notice */
.security-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.security-notice svg {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.security-notice a {
    color: var(--primary-color);
    text-decoration: none;
}

.security-notice a:hover {
    text-decoration: underline;
}

/* Results Section */
.results-section {
    margin-bottom: 2rem;
}

.results-section.hidden {
    display: none;
}

.result-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1rem;
    border-left: 4px solid transparent;
}

.result-card.safe {
    border-left-color: var(--success-color);
    background: linear-gradient(to right, var(--success-bg), var(--bg-secondary));
}

.result-card.compromised {
    border-left-color: var(--danger-color);
    background: linear-gradient(to right, var(--danger-bg), var(--bg-secondary));
}

.result-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.result-icon {
    font-size: 1.5rem;
}

.result-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.result-message {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.breach-count {
    font-size: 0.9rem;
    color: var(--danger-color);
}

.breach-count.hidden {
    display: none;
}

/* Strength Card */
.strength-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1rem;
}

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

.strength-meter {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.strength-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s, background-color 0.3s;
    width: 0;
}

.strength-bar.very-weak { width: 20%; background: var(--danger-color); }
.strength-bar.weak { width: 40%; background: #f97316; }
.strength-bar.fair { width: 60%; background: var(--warning-color); }
.strength-bar.strong { width: 80%; background: #84cc16; }
.strength-bar.very-strong { width: 100%; background: var(--success-color); }

.strength-label {
    font-weight: 600;
    margin-bottom: 1rem;
}

.strength-label.very-weak { color: var(--danger-color); }
.strength-label.weak { color: #f97316; }
.strength-label.fair { color: var(--warning-color); }
.strength-label.strong { color: #84cc16; }
.strength-label.very-strong { color: var(--success-color); }

.strength-details {
    list-style: none;
    display: grid;
    gap: 0.5rem;
}

.strength-details li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.strength-details li::before {
    content: '✓';
    color: var(--success-color);
    font-weight: bold;
}

.strength-details li.missing::before {
    content: '✗';
    color: var(--danger-color);
}

/* Recommendations Card */
.recommendations-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

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

#recommendations-list {
    list-style: none;
    display: grid;
    gap: 0.75rem;
}

#recommendations-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

#recommendations-list li::before {
    content: '💡';
    flex-shrink: 0;
}

/* Info Section */
.info-section {
    margin-bottom: 2rem;
}

.info-section h2 {
    color: white;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

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

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

.info-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-icon svg {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

.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);
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

footer a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

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

    h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .checker-section {
        padding: 1.5rem 1rem;
    }

    .logo-container {
        flex-direction: column;
        gap: 0.5rem;
    }

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

    .result-card,
    .strength-card,
    .recommendations-card {
        padding: 1rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-section:not(.hidden) {
    animation: fadeIn 0.3s ease-out;
}

/* Accessibility */
@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-color);
    outline-offset: 2px;
}

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