/* Advanced Password Strength Checker - Modern CSS */
:root {
    --primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-dark: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    --secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    --warning: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    --danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --dark: #1a202c;
    --light: #f7fafc;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border: #e2e8f0;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Strength Colors */
    --very-weak: #dc2626;
    --weak: #ea580c;
    --fair: #ca8a04;
    --good: #16a34a;
    --strong: #059669;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.tool-page {
    padding: 2rem 1rem;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 140px);
}

.tool-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-bottom: 2rem;
}

/* Enhanced Header Section */
.header-section {
    background: var(--primary);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="25" cy="25" r="2" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="50" cy="10" r="1.5" fill="%23ffffff" opacity="0.1"/><circle cx="10" cy="60" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="90" cy="40" r="2" fill="%23ffffff" opacity="0.1"/></svg>') repeat;
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-1%, -1%) rotate(90deg); }
    50% { transform: translate(1%, -2%) rotate(180deg); }
    75% { transform: translate(-2%, 1%) rotate(270deg); }
}

.header-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.header-section h1 i {
    margin-right: 0.75rem;
    color: #f093fb;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.tool-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.feature-badges {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.badge {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.badge i {
    font-size: 1rem;
}

/* Tool Interface */
.tool-interface {
    padding: 2rem;
}

.checker-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Input Section */
.input-section {
    margin-bottom: 3rem;
}

.password-input-container {
    max-width: 600px;
    margin: 0 auto;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.input-label i {
    color: #667eea;
}

.password-input {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.password-input:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), var(--shadow);
}

#password {
    flex: 1;
    padding: 1rem 1.25rem;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

#password::placeholder {
    color: var(--text-secondary);
}

.icon-btn, .generate-btn {
    background: transparent;
    border: none;
    padding: 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover, .generate-btn:hover {
    background: #f8fafc;
    color: #667eea;
}

.generate-btn {
    border-left: 1px solid var(--border);
}

.password-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: center;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    font-size: 0.9rem;
}

.action-btn.primary {
    background: var(--primary);
    color: white;
}

.action-btn.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.action-btn.secondary {
    background: #f8fafc;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.action-btn.secondary:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Analysis Section */
.analysis-section {
    margin-bottom: 3rem;
}

.strength-display {
    background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.strength-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.strength-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.strength-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.strength-meter {
    position: relative;
    height: 16px;
    background: #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 8px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.strength-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.strength-segments {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
}

.segment {
    flex: 1;
    border-right: 2px solid white;
}

.segment:last-child {
    border-right: none;
}

.strength-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

#strength-text {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crack-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Analysis Grid */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.analysis-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.analysis-card h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

/* Criteria List */
.criteria-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.criteria-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: var(--radius);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.criteria-item.passed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(22, 163, 74, 0.05));
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.criteria-item.failed {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.05));
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.criteria-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.criteria-item.passed .criteria-icon {
    background: var(--success);
    color: white;
}

.criteria-item.failed .criteria-icon {
    background: var(--danger);
    color: white;
}

.criteria-score {
    margin-left: auto;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.criteria-item.passed .criteria-score {
    color: #22c55e;
}

.criteria-item.failed .criteria-score {
    color: #ef4444;
}

/* Suggestions */
.suggestions-list {
    min-height: 100px;
}

.suggestion-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-secondary);
    text-align: center;
}

.suggestion-placeholder i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #cbd5e1;
}

.suggestion-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
}

.suggestion-item i {
    color: #f59e0b;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #667eea;
}

/* Info Section */
.info-section {
    margin-top: 3rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    border-top: 4px solid #667eea;
}

.info-card h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.info-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-card li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    line-height: 1.6;
}

.info-card li::before {
    content: '✓';
    color: #22c55e;
    font-weight: bold;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

/* Strength Color Classes */
.strength-very-weak {
    background: linear-gradient(135deg, var(--very-weak), #b91c1c) !important;
}

.strength-weak {
    background: linear-gradient(135deg, var(--weak), #c2410c) !important;
}

.strength-fair {
    background: linear-gradient(135deg, var(--fair), #a16207) !important;
}

.strength-good {
    background: linear-gradient(135deg, var(--good), #15803d) !important;
}

.strength-strong {
    background: linear-gradient(135deg, var(--strong), #047857) !important;
}

/* Comprehensive Responsive Design */

/* Large screens (1200px and up) */
@media (min-width: 1200px) {
    .analysis-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .header-section h1 {
        font-size: 3rem;
    }
}

/* Medium screens (992px to 1199px) */
@media (max-width: 1199px) and (min-width: 992px) {
    .header-section {
        padding: 2.5rem 2rem;
    }
    
    .header-section h1 {
        font-size: 2.2rem;
    }
    
    .analysis-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet screens (768px to 991px) */
@media (max-width: 991px) and (min-width: 768px) {
    .tool-page {
        padding: 1.5rem 1rem;
    }
    
    .tool-interface {
        padding: 1.5rem;
    }
    
    .header-section {
        padding: 2rem 1.5rem;
    }
    
    .header-section h1 {
        font-size: 2rem;
    }
    
    .feature-badges {
        gap: 0.5rem;
    }
    
    .badge {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
    }
    
    .password-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .action-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
}

/* Mobile screens (575px and below) */
@media (max-width: 767px) {
    .tool-page {
        padding: 1rem 0.5rem;
    }
    
    .tool-interface {
        padding: 1rem;
    }
    
    .header-section {
        padding: 1.5rem 1rem;
    }
    
    .header-section h1 {
        font-size: 1.8rem;
    }
    
    .header-section h1 i {
        display: block;
        margin-bottom: 0.5rem;
        margin-right: 0;
    }
    
    .tool-description {
        font-size: 1rem;
    }
    
    .feature-badges {
        gap: 0.5rem;
    }
    
    .badge {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        flex: 1;
        justify-content: center;
        min-width: 0;
    }
    
    .password-input {
        flex-direction: column;
    }
    
    #password {
        width: 100%;
        border-bottom: 1px solid var(--border);
    }
    
    .icon-btn, .generate-btn {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border);
    }
    
    .strength-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .strength-label {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .analysis-card {
        padding: 1rem;
    }
    
    .criteria-item {
        padding: 0.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .info-card {
        padding: 1.5rem;
    }
}

/* Extra small devices (400px and below) */
@media (max-width: 400px) {
    .header-section h1 {
        font-size: 1.5rem;
    }
    
    .tool-description {
        font-size: 0.9rem;
    }
    
    .badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    
    .strength-display {
        padding: 1rem;
    }
    
    .analysis-card {
        padding: 0.75rem;
    }
    
    .info-card {
        padding: 1rem;
    }
    
    .action-btn {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }
}

/* Animation for password input focus */
@keyframes focusRing {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.password-input:focus-within {
    animation: focusRing 0.6s ease-out;
}

/* Loading state */
.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 #667eea;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideInRight 0.3s ease;
}

.notification.success {
    background: var(--success);
    color: white;
}

.notification.error {
    background: var(--danger);
    color: white;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}
