/**
 * Password Generator Tool Styles
 * Extends main.css with tool-specific styling
 */

.password-generator-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Option Sections */
.option-section {
    padding: 1.25rem;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.option-title {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.option-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #1f2937;
}

/* Length Slider */
.length-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.length-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color, #3b82f6);
    min-width: 3rem;
    text-align: right;
}

.length-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e5e7eb;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.length-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color, #3b82f6);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.length-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5);
}

.length-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: var(--primary-color, #3b82f6);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
}

.length-marks {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Checkbox Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.secondary-options {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.option-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

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

.checkbox-label {
    font-size: 0.9rem;
    color: #1f2937;
}

/* Quantity Row */
.quantity-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quantity-input {
    width: 80px;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
    color: #1f2937;
    text-align: center;
    transition: border-color 0.2s ease;
}

.quantity-input:focus {
    outline: none;
    border-color: var(--primary-color, #3b82f6);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.generate-btn,
.btn-copy-all,
.btn-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.generate-btn {
    background: #3b82f6;
    color: white;
    flex: 1;
}

.generate-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-copy-all {
    background: #10b981;
    color: white;
}

.btn-copy-all:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-clear {
    background: #f3f4f6;
    color: #1f2937;
    border: 2px solid #e5e7eb;
}

.btn-clear:hover {
    background: #e5e7eb;
    border-color: #6b7280;
}

/* Output Container */
.output-container {
    margin-top: 1rem;
}

.output-title {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.password-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Password Item */
.password-item {
    padding: 1rem;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: border-color 0.2s ease;
}

.password-item:hover {
    border-color: var(--primary-color, #3b82f6);
}

.password-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.password-text {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    font-size: 1rem;
    color: #1f2937;
    word-break: break-all;
    flex: 1;
    padding: 0.5rem 0;
}

.password-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--primary-color, #3b82f6);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.password-copy-btn:hover {
    background: rgba(59, 130, 246, 0.1);
}

.password-copy-btn:active {
    transform: scale(0.95);
}

/* Strength Row */
.strength-row {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.strength-bar {
    height: 4px;
    border-radius: 2px;
    margin-bottom: 0.5rem;
    background: #e5e7eb;
    position: relative;
    overflow: hidden;
}

.strength-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.strength-bar.strength-weak::before {
    width: 20%;
    background: #ef4444;
}

.strength-bar.strength-fair::before {
    width: 40%;
    background: #f97316;
}

.strength-bar.strength-good::before {
    width: 60%;
    background: #eab308;
}

.strength-bar.strength-strong::before {
    width: 80%;
    background: #22c55e;
}

.strength-bar.strength-very-strong::before {
    width: 100%;
    background: #10b981;
}

.strength-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.strength-label {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.strength-label.strength-weak {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.strength-label.strength-fair {
    color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

.strength-label.strength-good {
    color: #ca8a04;
    background: rgba(234, 179, 8, 0.1);
}

.strength-label.strength-strong {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.strength-label.strength-very-strong {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.strength-details {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Copy Notification */
.copy-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--success-color, #10b981);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 600;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.copy-notification.error {
    background: var(--error-color, #ef4444);
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .generate-btn,
    .btn-copy-all,
    .btn-clear {
        width: 100%;
    }

    .copy-notification {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .password-text {
        font-size: 0.85rem;
    }

    .strength-info {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Dark Theme Support - System Preference */
@media (prefers-color-scheme: dark) {
    .option-section {
        background: #1e293b;
        border-color: #334155;
    }

    .option-title,
    .output-title {
        color: #e2e8f0;
    }

    .option-label,
    .checkbox-label {
        color: #e2e8f0;
    }

    .length-slider {
        background: #334155;
    }

    .length-marks {
        color: #94a3b8;
    }

    .secondary-options {
        border-color: #334155;
    }

    .quantity-input {
        background: #1e293b;
        border-color: #334155;
        color: #e2e8f0;
    }

    .password-item {
        background: #1e293b;
        border-color: #334155;
    }

    .password-item:hover {
        border-color: var(--primary-color, #3b82f6);
    }

    .password-text {
        color: #e2e8f0;
    }

    .strength-row {
        border-color: #334155;
    }

    .strength-bar {
        background: #334155;
    }

    .strength-details {
        color: #94a3b8;
    }

    .btn-clear {
        background: #1e293b;
        border-color: #334155;
        color: #e2e8f0;
    }

    .btn-clear:hover {
        background: #334155;
        border-color: #475569;
    }
}

/* Light Theme Specific (when explicitly set) */
[data-theme="light"] .option-section {
    background: #f8f9fa;
    border-color: #e5e7eb;
}

[data-theme="light"] .option-title,
[data-theme="light"] .output-title {
    color: #1f2937;
}

[data-theme="light"] .option-label,
[data-theme="light"] .checkbox-label {
    color: #1f2937;
}

[data-theme="light"] .length-slider {
    background: #e5e7eb;
}

[data-theme="light"] .length-marks {
    color: #6b7280;
}

[data-theme="light"] .secondary-options {
    border-color: #e5e7eb;
}

[data-theme="light"] .quantity-input {
    background: #ffffff;
    border-color: #e5e7eb;
    color: #1f2937;
}

[data-theme="light"] .password-item {
    background: #ffffff;
    border-color: #e5e7eb;
}

[data-theme="light"] .password-item:hover {
    border-color: var(--primary-color, #3b82f6);
}

[data-theme="light"] .password-text {
    color: #1f2937;
}

[data-theme="light"] .strength-row {
    border-color: #e5e7eb;
}

[data-theme="light"] .strength-bar {
    background: #e5e7eb;
}

[data-theme="light"] .strength-details {
    color: #6b7280;
}

[data-theme="light"] .btn-clear {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #1f2937;
}

[data-theme="light"] .btn-clear:hover {
    background: #e5e7eb;
    border-color: #6b7280;
}

/* Dark Theme Specific (when explicitly set) */
[data-theme="dark"] .option-section {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .option-title,
[data-theme="dark"] .output-title {
    color: #e2e8f0;
}

[data-theme="dark"] .option-label,
[data-theme="dark"] .checkbox-label {
    color: #e2e8f0;
}

[data-theme="dark"] .length-slider {
    background: #334155;
}

[data-theme="dark"] .length-marks {
    color: #94a3b8;
}

[data-theme="dark"] .secondary-options {
    border-color: #334155;
}

[data-theme="dark"] .quantity-input {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .password-item {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .password-item:hover {
    border-color: var(--primary-color, #3b82f6);
}

[data-theme="dark"] .password-text {
    color: #e2e8f0;
}

[data-theme="dark"] .strength-row {
    border-color: #334155;
}

[data-theme="dark"] .strength-bar {
    background: #334155;
}

[data-theme="dark"] .strength-details {
    color: #94a3b8;
}

[data-theme="dark"] .btn-clear {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .btn-clear:hover {
    background: #334155;
    border-color: #475569;
}
