/* 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;
    --danger-color: #ef4444;
    --danger-light: #fee2e2;
    --danger-dark: #dc2626;
    --success-color: #22c55e;
    --success-light: #dcfce7;
    --success-dark: #16a34a;
    --warning-color: #f59e0b;
    --warning-light: #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 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: all 0.2s ease;
}

html {
    scroll-behavior: smooth;
}

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

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    padding: 40px 20px;
    color: white;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo-img {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-top: 10px;
}

/* Main Content */
main {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 30px;
    flex: 1;
}

/* Alert Banner */
.alert-banner {
    border-radius: var(--radius-md);
    margin-bottom: 25px;
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

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

.alert-banner.hidden {
    display: none;
}

.alert-banner.danger {
    background: var(--danger-light);
    border: 1px solid var(--danger-color);
}

.alert-banner.success {
    background: var(--success-light);
    border: 1px solid var(--success-color);
}

.alert-banner.warning {
    background: var(--warning-light);
    border: 1px solid var(--warning-color);
}

.alert-content {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    gap: 12px;
}

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

.alert-message {
    flex: 1;
    font-weight: 500;
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    line-height: 1;
    transition: var(--transition);
}

.alert-close:hover {
    color: var(--text-primary);
}

/* Tabs */
.tab-container {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    background: var(--bg-tertiary);
    padding: 5px;
    border-radius: var(--radius-lg);
}

.tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

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

.tab.active {
    background: var(--bg-primary);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* Check Sections */
.check-section {
    display: none;
}

.check-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

.input-wrapper {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.input-wrapper input {
    flex: 1;
    min-width: 200px;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition);
}

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

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

.toggle-btn:hover {
    background: var(--bg-tertiary);
}

.check-btn {
    padding: 14px 28px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.check-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

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

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

.privacy-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.privacy-note::before {
    content: '🔒';
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

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

/* Results Section */
.results-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}

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

.result-card {
    padding: 25px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.result-card.breached {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 1px solid var(--danger-color);
}

.result-card.safe {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border: 1px solid var(--success-color);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

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

.result-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.result-card.breached .result-title {
    color: var(--danger-dark);
}

.result-card.safe .result-title {
    color: var(--success-dark);
}

.result-description {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.breach-list {
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-md);
    padding: 20px;
}

.breach-list h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.breach-item {
    padding: 15px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    border-left: 4px solid var(--danger-color);
}

.breach-item:last-child {
    margin-bottom: 0;
}

.breach-name {
    font-weight: 600;
    color: var(--danger-dark);
    margin-bottom: 5px;
}

.breach-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.breach-data {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

.password-count {
    font-size: 2rem;
    font-weight: 700;
    color: var(--danger-dark);
    margin: 10px 0;
}

.action-steps {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-md);
}

.action-steps h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.action-steps ul {
    list-style: none;
}

.action-steps li {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.action-steps li:last-child {
    border-bottom: none;
}

.action-steps li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* Recommendations Section */
.recommendations-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.recommendations-section h2,
.privacy-tips-section h2,
.how-it-works-section h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--text-primary);
    text-align: center;
}

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

.recommendation-card {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition);
}

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

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

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

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

/* Privacy Tips Section */
.privacy-tips-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.tips-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tip {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.tip:hover {
    background: var(--bg-tertiary);
}

.tip-number {
    width: 35px;
    height: 35px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.tip-content h4 {
    font-size: 1rem;
    margin-bottom: 5px;
    color: var(--text-primary);
}

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

/* How It Works Section */
.how-it-works-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.step {
    text-align: center;
    padding: 25px;
}

.step-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.step h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

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

/* Footer */
footer {
    padding: 30px 20px;
    text-align: center;
    color: white;
    margin-top: 30px;
}

.footer-content {
    opacity: 0.9;
}

.powered-by {
    font-size: 1rem;
    margin-bottom: 10px;
}

.powered-by a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    transition: var(--transition);
}

.powered-by a:hover {
    border-bottom-color: white;
}

.disclaimer {
    font-size: 0.85rem;
    margin-bottom: 10px;
    opacity: 0.8;
}

.disclaimer a {
    color: white;
    text-decoration: underline;
}

.copyright {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header {
        padding: 30px 15px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .tagline {
        font-size: 1rem;
    }

    main {
        padding: 20px;
    }

    .tab-container {
        flex-direction: column;
    }

    .input-wrapper {
        flex-direction: column;
    }

    .input-wrapper input {
        min-width: 100%;
    }

    .check-btn {
        width: 100%;
    }

    .toggle-btn {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        border: none;
        background: transparent;
    }

    .input-wrapper {
        position: relative;
    }

    #password-section .input-wrapper input {
        padding-right: 50px;
    }

    #password-section .input-wrapper .check-btn {
        position: static;
    }

    .recommendations-grid,
    .steps-container {
        grid-template-columns: 1fr;
    }

    .result-header {
        flex-direction: column;
        text-align: center;
    }

    .result-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .logo {
        flex-direction: column;
        gap: 10px;
    }

    main {
        padding: 15px;
    }

    .recommendation-card,
    .tip {
        padding: 15px;
    }

    .tip {
        flex-direction: column;
        text-align: center;
    }

    .tip-number {
        margin: 0 auto;
    }
}

/* 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 accessibility */
button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 3px 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;
    }

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

    .recommendation-card:hover,
    .tip:hover {
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    }

    .breach-list,
    .action-steps {
        background: rgba(0, 0, 0, 0.2);
    }

    .breach-item {
        background: var(--bg-secondary);
    }

    .result-card.breached {
        background: linear-gradient(135deg, #450a0a 0%, #7f1d1d 100%);
    }

    .result-card.safe {
        background: linear-gradient(135deg, #052e16 0%, #166534 100%);
    }

    .result-card.breached .result-title {
        color: #fca5a5;
    }

    .result-card.safe .result-title {
        color: #86efac;
    }
}
