:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --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: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --strength-weak: #ef4444;
    --strength-fair: #f59e0b;
    --strength-good: #3b82f6;
    --strength-strong: #10b981;
    --strength-excellent: #059669;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f766e 0%, #1e40af 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(16, 185, 129, 0.3), transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.3), transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.2), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
}

.title {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #0f766e 0%, #1e40af 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
}

.language-selector {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.language-selector select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.language-selector select:hover {
    border-color: var(--primary-color);
}

.main-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.mode-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.tab {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: var(--bg-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.tab.active {
    background: linear-gradient(135deg, #0f766e 0%, #1e40af 100%);
    color: white;
}

.tab:hover:not(.active) {
    background: var(--border-color);
}

.settings-panel {
    margin-bottom: 1.5rem;
}

.settings-panel.hidden {
    display: none;
}

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

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.select {
    width: 100%;
    padding: 0.6rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: var(--bg-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.range-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.range-input {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f766e 0%, #1e40af 100%);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.range-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f766e 0%, #1e40af 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.range-value {
    min-width: 2.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.action-buttons {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.btn {
    padding: 0.75rem 2.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #0f766e 0%, #1e40af 100%);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(15, 118, 110, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(15, 118, 110, 0.6);
}

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

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

.btn-small {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

.btn-icon {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.btn-icon.copied {
    border-color: var(--success-color);
    color: var(--success-color);
    background: rgba(16, 185, 129, 0.05);
}

.result-section {
    padding: 1.5rem;
}

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

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

.result-text {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', Consolas, monospace;
    font-size: 1.1rem;
    word-break: break-all;
    user-select: all;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.strength-section {
    margin-top: 1rem;
}

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

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

.strength-info {
    display: flex;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.strength-label {
    color: var(--text-secondary);
}

.strength-text {
    font-weight: 600;
}

.strength-details {
    display: flex;
    gap: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.history-section {
    margin-top: 1.5rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.history-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.history-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 1rem;
    font-size: 0.9rem;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: background 0.2s;
}

.history-item:hover {
    background: var(--border-color);
}

.history-item-text {
    flex: 1;
    font-family: 'Courier New', Consolas, monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: all;
}

.history-item-type {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    white-space: nowrap;
}

.history-item-copy {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem;
    display: flex;
    transition: color 0.2s;
}

.history-item-copy:hover {
    color: var(--primary-color);
}

.features {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-lg);
}

.features-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #0f766e 0%, #1e40af 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.feature-card {
    text-align: center;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    transition: all 0.3s;
}

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

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.feature-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

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

.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success { background: var(--success-color); }
.notification-error { background: var(--error-color); }
.notification-info { background: var(--info-color); }

@media (max-width: 768px) {
    .container { padding: 1rem; }
    .title { font-size: 1.75rem; }
    .settings-grid { grid-template-columns: 1fr; }
    .features-grid { grid-template-columns: 1fr 1fr; }
    .language-selector { position: static; margin-top: 1rem; }
    .result-text { font-size: 0.95rem; }
    .strength-details { flex-direction: column; gap: 0.25rem; }
}

@media (max-width: 480px) {
    .features-grid { grid-template-columns: 1fr; }
}

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