/* ============================================
   Password Generator & Tester - Main Styles
   ============================================ */

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1f2937;
    --light: #f8fafc;
    --gray: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
}

.container {
    max-width: 850px;
    margin: 0 auto;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1.5rem;
    border-radius: 60px;
}

.logo i {
    font-size: 1.5rem;
    color: white;
}

.logo span {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
}

.session-badge {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1.2rem;
    border-radius: 60px;
    color: white;
    font-size: 0.85rem;
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 0.85rem;
}

/* Main Tabs */
.main-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.main-tab {
    flex: 1;
    padding: 1rem;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 1rem;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.main-tab i {
    font-size: 1.2rem;
}

.main-tab:hover {
    background: rgba(255,255,255,0.25);
}

.main-tab.active {
    background: white;
    color: var(--primary);
}

.main-tab-content {
    display: none;
}

.main-tab-content.active {
    display: block;
}

/* Main Card */
.main-card {
    background: white;
    border-radius: 1.5rem;
    padding: 1.8rem;
    box-shadow: var(--shadow);
}

/* Mode Selector */
.mode-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: var(--light);
    border-radius: 1rem;
    padding: 0.5rem;
}

.mode-btn {
    flex: 1;
    padding: 0.8rem;
    border: none;
    background: transparent;
    border-radius: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-family: inherit;
}

.mode-btn i {
    font-size: 1.2rem;
    display: block;
    margin-bottom: 0.3rem;
}

.mode-btn span {
    font-weight: 600;
    font-size: 0.85rem;
    display: block;
}

.mode-btn small {
    font-size: 0.65rem;
    color: var(--gray);
    display: block;
    margin-top: 0.2rem;
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.mode-btn.active small {
    color: rgba(255,255,255,0.8);
}

/* Password Section */
.password-section {
    margin-bottom: 1.5rem;
}

.password-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.edit-badge {
    font-size: 0.65rem;
    background: #e0e7ff;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    color: #3730a3;
}

.edit-badge i {
    font-size: 0.6rem;
    margin-right: 0.2rem;
}

.password-display {
    background: var(--light);
    border: 2px solid var(--border);
    border-radius: 1rem;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.2s;
}

.password-display:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.password-input {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: none;
    background: transparent;
    padding: 0.3rem;
    color: var(--dark);
    outline: none;
}

.copy-btn, .refresh-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.4rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    color: var(--gray);
}

.copy-btn:hover, .refresh-btn:hover {
    background: var(--border);
    color: var(--primary);
}

.copy-message {
    text-align: center;
    font-size: 0.7rem;
    color: var(--success);
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.copy-message.show {
    opacity: 1;
}

/* Options Section */
.options-section h3 {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.option-group {
    margin-bottom: 1.2rem;
}

.option-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.option-label label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--dark);
}

#lengthValue, #wordCountValue {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(102,126,234,0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
}

input[type="range"] {
    width: 100%;
    height: 5px;
    border-radius: 3px;
    background: var(--border);
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    font-size: 0.85rem;
    background: white;
}

/* Checkbox Group */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--gray);
}

.checkbox-label input {
    display: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: inline-block;
    position: relative;
    transition: all 0.2s;
}

.checkbox-label input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
}

/* Strength Section */
.strength-section h3 {
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.strength-meter {
    background: var(--border);
    border-radius: 1rem;
    height: 8px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.strength-bar {
    height: 100%;
    width: 0%;
    transition: width 0.3s, background 0.3s;
    border-radius: 1rem;
}

.strength-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
}

#strengthLabel, #testStrengthLabel {
    font-weight: 600;
}

#entropyInfo, #testEntropyInfo {
    color: var(--gray);
}

.remember-tip {
    background: #fef3c7;
    border-radius: 0.8rem;
    padding: 0.7rem;
    margin-top: 0.8rem;
    font-size: 0.7rem;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.remember-tip i {
    font-size: 0.9rem;
}

/* Feature Buttons */
.feature-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin: 1.5rem 0 1rem;
}

.feature-btn {
    flex: 1;
    padding: 0.7rem 1rem;
    border: 2px solid var(--border);
    background: white;
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.feature-btn:hover {
    border-color: var(--primary);
    background: var(--light);
    transform: translateY(-2px);
}

/* Password Tips */
.password-tips {
    background: var(--light);
    border-radius: 1rem;
    padding: 0.8rem;
}

.password-tips h4 {
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.password-tips ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.4rem;
}

.password-tips li {
    font-size: 0.7rem;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.password-tips li i {
    color: var(--success);
    font-size: 0.65rem;
}

/* History Section */
.history-section {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: 1rem;
}

.history-section h3 {
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#historyList {
    max-height: 130px;
    overflow-y: auto;
    margin-bottom: 0.6rem;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem;
    background: var(--light);
    border-radius: 0.5rem;
    margin-bottom: 0.3rem;
    font-family: monospace;
    font-size: 0.75rem;
}

.history-item button {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--gray);
    padding: 0.2rem 0.5rem;
    border-radius: 0.3rem;
}

.history-item button:hover {
    background: var(--border);
    color: var(--primary);
}

.clear-history-btn {
    width: 100%;
    padding: 0.4rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.7rem;
}

.clear-history-btn:hover {
    background: #dc2626;
}

/* Tester Section */
.tester-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.tester-header i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.tester-header h2 {
    font-size: 1.3rem;
    color: var(--dark);
    margin-bottom: 0.3rem;
}

.tester-header p {
    color: var(--gray);
    font-size: 0.8rem;
}

.tester-input-group {
    margin-bottom: 1.2rem;
}

.tester-input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--dark);
}

.password-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.password-input-wrapper input {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid var(--border);
    border-radius: 0.8rem;
    font-size: 0.9rem;
    font-family: monospace;
    transition: all 0.2s;
}

.password-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.toggle-password-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.6rem;
    border-radius: 0.8rem;
    color: var(--gray);
    transition: all 0.2s;
}

.toggle-password-btn:hover {
    background: var(--light);
    color: var(--primary);
}

.tester-strength-section {
    margin-bottom: 1.2rem;
}

.tester-meter {
    margin-bottom: 0.4rem;
}

.tester-feedback {
    background: var(--light);
    border-radius: 1rem;
    padding: 0.8rem;
    margin-bottom: 1.2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.6rem;
}

.feedback-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray);
}

.feedback-item i {
    font-size: 0.65rem;
}

.feedback-item.valid i {
    color: var(--success);
}

.feedback-item.invalid i {
    color: var(--danger);
}

.tester-warning {
    background: #fee2e2;
    border-left: 4px solid var(--danger);
    padding: 0.8rem;
    border-radius: 0.8rem;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #991b1b;
}

.tester-tips {
    background: #fef3c7;
    border-radius: 1rem;
    padding: 0.8rem;
    margin-bottom: 1.2rem;
}

.tester-tips h4 {
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
    color: #92400e;
}

.tester-tips ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.4rem;
}

.tester-tips li {
    font-size: 0.7rem;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tester-tips li i {
    color: var(--success);
}

.tester-actions {
    display: flex;
    gap: 0.8rem;
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    margin-top: 1.5rem;
    font-size: 0.8rem;
}

.back-link:hover {
    color: white;
}

/* Footer */
.footer {
    margin-top: 2rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.75rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-credit {
    color: rgba(255,255,255,0.6);
    font-size: 0.7rem;
}

.footer-credit strong {
    color: white;
}

/* Responsive */
@media (max-width: 650px) {
    .main-card {
        padding: 1.2rem;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .main-tabs {
        flex-direction: column;
    }
    
    .mode-selector {
        flex-direction: column;
    }
    
    .mode-btn {
        text-align: center;
    }
    
    .password-display {
        flex-wrap: wrap;
    }
    
    .password-input {
        width: 100%;
        text-align: center;
    }
    
    .feature-buttons, .tester-actions {
        flex-direction: column;
    }
    
    .checkbox-group, .tester-feedback {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}