/* Main CSS for Password Strength Analyzer */

/* Custom Properties */
:root {
    --primary-50: #f2f5f3;
    --primary-100: #e6ebe8;
    --primary-500: #84a98c;
    --primary-600: #52796f;
    --primary-700: #3d5a4a;
    --primary-900: #2d3e2e;
    --success-50: #f0fdf4;
    --success-500: #22c55e;
    --success-600: #16a34a;
    --warning-50: #fffbeb;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    --danger-50: #fef2f2;
    --danger-500: #ef4444;
    --danger-600: #dc2626;
    --neutral-50: #f8f9fa;
    --neutral-100: #cad2c5;
    --neutral-200: #a8b5a3;
    --neutral-300: #8a9a8a;
    --neutral-400: #6b7a6b;
    --neutral-500: #52796f;
    --neutral-600: #3d5a4a;
    --neutral-700: #2d3e2e;
    --neutral-800: #1f2b1f;
    --neutral-900: #0f1a0f;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f9fafb;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Tab Styles */
.tab-content {
    transition: opacity 0.3s ease;
}

.tab-content.hidden {
    display: none;
}

/* Preset Button Styles */
.preset-btn {
    padding: 12px 16px;
    border: 2px solid;
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 14px;
}

.preset-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.preset-btn:active {
    transform: translateY(0);
}

/* Range Slider Styles */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: var(--primary-600);
    height: 20px;
    width: 20px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-track {
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
    border: none;
}

input[type="range"]::-moz-range-thumb {
    background: var(--primary-600);
    height: 20px;
    width: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Copy Animation */
.copy-success {
    animation: copySuccess 0.3s ease;
}

@keyframes copySuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Focus Styles */
button:focus,
input:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* Custom Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes strengthBar {
    from {
        width: 0%;
    }
    to {
        width: var(--strength-width);
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in {
    animation: slideIn 0.4s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

/* Strength Bar Animation */
.strength-bar-animate {
    animation: strengthBar 1s ease-out;
}

/* Card Hover Effects */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Password Input Styles */
.password-input-container {
    position: relative;
}

.password-input-container:focus-within {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* Password Input Field Mobile Responsiveness */
.password-input-field {
    display: flex;
    align-items: stretch;
    border: 2px solid var(--neutral-200);
    border-radius: 0.5rem;
    transition: border-color 0.2s ease;
    overflow: hidden;
    min-height: 48px;
}

.password-input-field:focus-within {
    border-color: var(--primary-500);
}

.password-input-field input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    background: transparent;
    min-width: 0;
}

.password-input-field input::placeholder {
    color: #9ca3af;
}

.password-input-field button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 48px;
    flex-shrink: 0;
}

.password-input-field button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.password-input-field button:active {
    background-color: rgba(0, 0, 0, 0.1);
}

.password-input-field button svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #6b7280;
    transition: color 0.2s ease;
}

.password-input-field button:hover svg {
    color: #374151;
}

.password-input-field button#clearPassword:hover svg {
    color: #dc2626;
}

.password-input-field .border-l {
    border-left: 1px solid var(--neutral-200);
}

/* Mobile-specific password input styles */
@media (max-width: 640px) {
    .password-input-field {
        min-height: 44px;
    }
    
    .password-input-field input {
        padding: 0.625rem 0.875rem;
        font-size: 1rem;
    }
    
    .password-input-field button {
        padding: 0.625rem;
        min-width: 44px;
    }
    
    .password-input-field button svg {
        width: 1.125rem;
        height: 1.125rem;
    }
    
    /* Ensure buttons stay aligned on very small screens */
    .password-input-field {
        flex-wrap: nowrap;
    }
    
    .password-input-field input {
        flex: 1 1 auto;
        min-width: 0;
    }
    
    .password-input-field button {
        flex: 0 0 auto;
    }
}

/* Extra small mobile devices */
@media (max-width: 375px) {
    .password-input-field {
        min-height: 40px;
    }
    
    .password-input-field input {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .password-input-field button {
        padding: 0.5rem;
        min-width: 40px;
    }
    
    .password-input-field button svg {
        width: 1rem;
        height: 1rem;
    }
}

/* Ensure proper touch targets on mobile */
@media (hover: none) and (pointer: coarse) {
    .password-input-field button {
        min-width: 44px;
        min-height: 44px;
    }
    
    .password-input-field button:active {
        background-color: rgba(0, 0, 0, 0.1);
    }
}

/* Strength Indicator Colors */
.strength-very-weak {
    color: var(--danger-500);
}

.strength-weak {
    color: #f97316;
}

.strength-medium {
    color: var(--warning-500);
}

.strength-strong {
    color: var(--success-600);
}

.strength-very-strong {
    color: var(--success-500);
}

/* Progress Bar Colors */
.progress-very-weak {
    background: linear-gradient(90deg, var(--danger-500) 0%, #fca5a5 100%);
}

.progress-weak {
    background: linear-gradient(90deg, #f97316 0%, #fed7aa 100%);
}

.progress-medium {
    background: linear-gradient(90deg, var(--warning-500) 0%, #fde68a 100%);
}

.progress-strong {
    background: linear-gradient(90deg, var(--success-600) 0%, #86efac 100%);
}

.progress-very-strong {
    background: linear-gradient(90deg, var(--success-500) 0%, #bbf7d0 100%);
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 200px;
    width: 100%;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-500);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
    .password-input-container input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .chart-container {
        height: 150px;
    }
    
    .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .text-4xl {
        font-size: 1.875rem;
    }
    
    .text-5xl {
        font-size: 2.25rem;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .bg-gray-50 {
        background-color: #ffffff;
    }
    
    .text-gray-600 {
        color: #000000;
    }
    
    .border-gray-200 {
        border-color: #000000;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .bg-white {
        background: white !important;
        border: 1px solid #000 !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Focus Visible for Better Accessibility */
.focus-visible:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* Button States */
.btn-primary {
    background-color: var(--primary-600);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--primary-700);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Input Styles */
.input-field {
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    width: 100%;
}

.input-field:focus {
    border-color: var(--primary-500);
    outline: none;
}

.input-field.error {
    border-color: var(--danger-500);
}

/* Tooltip Styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 300px;
    background-color: #1f2937;
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -150px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.875rem;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-glow {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.border-gradient {
    border: 2px solid;
    border-image: linear-gradient(135deg, var(--primary-500), var(--primary-700)) 1;
}

/* Performance Optimizations */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
}

/* Critical CSS for Above-the-fold Content */
.critical-content {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

/* Lazy Loading for Images */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

/* Privacy Policy and Terms of Service Page Styles */
.legal-page {
    background: linear-gradient(135deg, var(--neutral-50) 0%, var(--primary-50) 100%);
    min-height: 100vh;
}

.legal-page .prose {
    color: #374151;
    line-height: 1.7;
}

.legal-page .prose h2 {
    color: #111827;
    font-size: 2rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-200);
    padding-bottom: 0.5rem;
}

.legal-page .prose h3 {
    color: #1f2937;
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
    border-left: 4px solid var(--primary-500);
}

.legal-page .prose h4 {
    color: #374151;
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.legal-page .prose p {
    margin-bottom: 1rem;
    text-align: justify;
}

.legal-page .prose ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.legal-page .prose li {
    margin-bottom: 0.5rem;
    position: relative;
}

.legal-page .prose li::marker {
    color: var(--primary-500);
    font-weight: 600;
}

.legal-page .prose strong {
    color: #111827;
    font-weight: 600;
}

.legal-page .prose a {
    color: var(--primary-600);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.legal-page .prose a:hover {
    color: var(--primary-700);
    border-bottom-color: var(--primary-500);
}

.legal-page .prose a:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Legal Page Header */
.legal-page-header {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
    border-radius: 0 0 2rem 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.legal-page-header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.legal-page-header p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.legal-page-header .last-updated {
    font-size: 0.875rem;
    opacity: 0.7;
    font-style: italic;
}

/* Legal Content Container */
.legal-content {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.legal-content .prose {
    padding: 2rem;
}

/* Legal Navigation */
.legal-navigation {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.legal-navigation a {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.legal-navigation .btn-primary {
    background: var(--primary-600);
    color: white;
    border: 2px solid var(--primary-600);
}

.legal-navigation .btn-primary:hover {
    background: var(--primary-700);
    border-color: var(--primary-700);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(82, 121, 111, 0.3);
}

.legal-navigation .btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.legal-navigation .btn-secondary:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Legal Page Alerts */
.legal-alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.legal-alert.alert-info {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

.legal-alert.alert-warning {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

.legal-alert.alert-success {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #166534;
}

/* Legal Page Responsive Design */
@media (max-width: 768px) {
    .legal-page-header h1 {
        font-size: 2rem;
    }
    
    .legal-page-header p {
        font-size: 1rem;
    }
    
    .legal-content .prose {
        padding: 1.5rem;
    }
    
    .legal-page .prose h2 {
        font-size: 1.5rem;
    }
    
    .legal-page .prose h3 {
        font-size: 1.25rem;
    }
    
    .legal-navigation {
        flex-direction: column;
        align-items: center;
    }
    
    .legal-navigation a {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .legal-page-header {
        padding: 2rem 0;
        border-radius: 0 0 1rem 1rem;
    }
    
    .legal-page-header h1 {
        font-size: 1.75rem;
    }
    
    .legal-content .prose {
        padding: 1rem;
    }
    
    .legal-page .prose ul {
        padding-left: 1rem;
    }
}

/* Legal Page Print Styles */
@media print {
    .legal-page {
        background: white;
    }
    
    .legal-page-header {
        background: white;
        color: black;
        border-bottom: 2px solid #000;
        box-shadow: none;
    }
    
    .legal-content {
        box-shadow: none;
        border: none;
    }
    
    .legal-navigation {
        display: none;
    }
    
    .legal-page .prose a {
        color: black;
        text-decoration: underline;
    }
}

/* Legal Page Accessibility */
@media (prefers-reduced-motion: reduce) {
    .legal-navigation a {
        transition: none;
    }
    
    .legal-navigation a:hover {
        transform: none;
    }
}

@media (prefers-contrast: high) {
    .legal-page .prose h2,
    .legal-page .prose h3,
    .legal-page .prose h4 {
        border-color: #000;
    }
    
    .legal-page .prose a {
        color: #000;
        text-decoration: underline;
    }
    
    .legal-alert {
        border-width: 2px;
    }
} 