* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2196F3;
    --success-color: #4CAF50;
    --warning-color: #FFC107;
    --danger-color: #F44336;
    --purple-color: #9C27B0;
    --background-color: #f5f5f5;
    --paper-color: #ffffff;
    --text-color: #333333;
    --text-muted: #666666;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --paper-texture: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23f0f0f0' fill-opacity='0.3'%3E%3Cpath d='m36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background-color);
    background-image: var(--paper-texture);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.app-container {
    max-width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 80px;
}

.app-header {
    background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    box-shadow: var(--shadow);
}

.app-header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.app-header p {
    opacity: 0.9;
    font-size: 1rem;
}

.main-content {
    flex: 1;
    padding: 1rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.content-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.content-section.active {
    display: block;
}

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

.analyzer-container {
    background: var(--paper-color);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

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

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

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

#passwordInput {
    flex: 1;
    padding: 12px 50px 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: var(--paper-color);
}

#passwordInput:focus {
    outline: none;
    border-color: var(--primary-color);
}

.toggle-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: color 0.3s ease;
}

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

.strength-meter {
    margin-bottom: 1.5rem;
}

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

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

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

.strength-score {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.criteria-list {
    display: grid;
    gap: 0.5rem;
}

.criterion {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    background: rgba(244, 67, 54, 0.1);
    transition: background-color 0.3s ease;
}

.criterion.met {
    background: rgba(76, 175, 80, 0.1);
}

.criterion i {
    color: var(--danger-color);
    transition: color 0.3s ease;
}

.criterion.met i {
    color: var(--success-color);
}

.breach-check {
    margin: 1.5rem 0;
    text-align: center;
}

.btn-primary, .btn-secondary, .btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: white;
}

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

.btn-primary:hover {
    background: #1976D2;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--text-muted);
    color: white;
}

.btn-secondary:hover {
    background: #555;
}

.btn-danger {
    background: var(--danger-color);
}

.btn-danger:hover {
    background: #d32f2f;
}

.breach-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    display: none;
}

.breach-result.safe {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.breach-result.compromised {
    background: rgba(244, 67, 54, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.breach-result.loading {
    background: rgba(33, 150, 243, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.suggestions-container {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(156, 39, 176, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(156, 39, 176, 0.1);
}

.suggestions-container h3 {
    margin-bottom: 1rem;
    color: var(--purple-color);
}

#suggestionsList {
    list-style: none;
    padding: 0;
}

#suggestionsList li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(156, 39, 176, 0.1);
}

#suggestionsList li:last-child {
    border-bottom: none;
}

.education-container, .history-container, .settings-container {
    background: var(--paper-color);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.education-card {
    background: rgba(33, 150, 243, 0.05);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
}

.education-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.education-card ul {
    padding-left: 1.5rem;
}

.education-card li {
    margin-bottom: 0.5rem;
}

.history-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.history-item {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: var(--paper-color);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-style: italic;
}

.setting-group {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.setting-group:last-child {
    border-bottom: none;
}

.setting-group h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin-right: 1rem;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.criteria-settings label {
    display: block;
    margin-bottom: 0.5rem;
}

.criteria-settings input {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 80px;
    margin-left: 0.5rem;
}

.faq-section {
    background: var(--paper-color);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin: 1rem 0;
}

.faq-container {
    margin-top: 1rem;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 1rem;
    background: var(--paper-color);
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

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

.faq-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1rem 1rem 1rem;
    color: var(--text-muted);
    animation: fadeIn 0.3s ease-in-out;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--paper-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 60px;
}

.nav-item:hover {
    color: var(--primary-color);
    background: rgba(33, 150, 243, 0.1);
}

.nav-item.active {
    color: var(--primary-color);
    background: rgba(33, 150, 243, 0.1);
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
}

footer {
    background: var(--text-color);
    color: white;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
    margin-top: auto;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

@media (min-width: 768px) {
    .app-container {
        max-width: 1200px;
    }
    
    .app-header h1 {
        font-size: 2.5rem;
    }
    
    .main-content {
        padding: 2rem;
    }
    
    .analyzer-container, .education-container, .history-container, .settings-container, .faq-section {
        padding: 2rem;
    }
    
    .criteria-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .history-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .bottom-nav {
        position: relative;
        box-shadow: none;
        border-top: none;
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 2rem;
    }
    
    .app-container {
        padding-bottom: 0;
    }
}

@media (min-width: 1024px) {
    .criteria-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

.strength-very-weak { background-color: var(--danger-color); }
.strength-weak { background-color: #FF7043; }
.strength-fair { background-color: var(--warning-color); }
.strength-good { background-color: #8BC34A; }
.strength-strong { background-color: var(--success-color); }

.text-very-weak { color: var(--danger-color); }
.text-weak { color: #FF7043; }
.text-fair { color: var(--warning-color); }
.text-good { color: #8BC34A; }
.text-strong { color: var(--success-color); }
