/**
 * CCM Password Generator - Frontend Styles
 * Matches the clean theme of DNS, WHOIS, and IP lookup tools
 *
 * @package CCMResourceTools
 * @version 1.0.0
 */

/* Password Generator Form - Match other tools exactly */
.resource-tools-password .ccm-password-form input[type="range"] {
    width: 100%;
    accent-color: #0d6efd;
    margin-bottom: 4px;
    vertical-align: middle;
}

/* Ensure checkboxes are visible and styled properly */
.resource-tools-password .form-check {
    padding-left: 1.5em;
}

.resource-tools-password .form-check-input {
    width: 1.25em;
    height: 1.25em;
    margin-top: 0.125em;
    border: 1px solid #dee2e6;
    cursor: pointer;
    background-color: white;
}

.resource-tools-password .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.resource-tools-password .form-check-input:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.resource-tools-password .form-check-label {
    cursor: pointer;
    color: #212529;
}

/* Password Output Display - Make it clearly visible */
.ccm-password-output {
    word-break: break-all;
    user-select: all;
    background-color: #ffffff !important;
    border: 2px solid #dee2e6 !important;
    padding: 0.75rem;
    font-size: 14px;
    color: #212529 !important;
}

.ccm-password-output:focus {
    background-color: #fff !important;
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.ccm-copy-password-btn {
    white-space: nowrap;
    border: 2px solid #6c757d;
    background-color: white;
    color: #6c757d;
    padding: 0.65rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: all 0.2s ease;
}

.ccm-copy-password-btn svg {
    flex-shrink: 0;
}

.ccm-copy-label {
    font-size: 0.7rem;
}

.ccm-copy-password-btn:hover {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.ccm-copy-password-btn:active {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* Password Strength Bar */
.ccm-strength-progress {
    position: relative;
    height: 12px;
    border-radius: 999px;
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    overflow: hidden;
    display: block;
}

.ccm-strength-progress::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.12) 0%, rgba(253, 126, 20, 0.12) 50%, rgba(25, 135, 84, 0.12) 100%);
    pointer-events: none;
}

.ccm-password-strength-bar {
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), background 0.35s ease, box-shadow 0.35s ease;
    background: #dc3545;
    border-radius: 999px;
    height: 100%;
}

.ccm-password-strength-bar.is-poor {
    background: linear-gradient(135deg, #dc3545, #ff5f6d);
    box-shadow: 0 6px 18px rgba(220, 53, 69, 0.35);
}

.ccm-password-strength-bar.is-medium {
    background: linear-gradient(135deg, #fd7e14, #ffc107);
    box-shadow: 0 6px 18px rgba(253, 126, 20, 0.35);
}

.ccm-password-strength-bar.is-strong {
    background: linear-gradient(135deg, #198754, #38ef7d);
    box-shadow: 0 6px 18px rgba(56, 239, 125, 0.35);
}

.ccm-strength-feedback {
    font-size: 0.9rem;
    width: 100%;
    gap: 0.5rem;
}

.ccm-strength-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    color: #495057;
    border-color: #dee2e6;
    background-color: #f8f9fa;
}

.ccm-strength-pill.is-poor {
    color: #dc3545;
    border-color: rgba(220, 53, 69, 0.35);
    background-color: rgba(220, 53, 69, 0.1);
}

.ccm-strength-pill.is-medium {
    color: #fd7e14;
    border-color: rgba(253, 126, 20, 0.35);
    background-color: rgba(253, 126, 20, 0.1);
}

.ccm-strength-pill.is-strong {
    color: #198754;
    border-color: rgba(25, 135, 84, 0.35);
    background-color: rgba(25, 135, 84, 0.1);
}

.ccm-strength-tip {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Stat Boxes - Clear borders and backgrounds */
.ccm-stat-box {
    border: 2px solid #dee2e6;
    background-color: white;
    transition: all 0.2s ease;
}

.ccm-stat-box:hover {
    border-color: #0d6efd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.ccm-stat-box small {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    font-weight: 600;
}

.ccm-stat-box strong {
    font-size: 1.1rem;
    color: #0d6efd;
    font-weight: 700;
}

/* Alert Customization */
.resource-tools-password .alert-info {
    background-color: #cfe2ff;
    border: 1px solid #b6d4fe;
    color: #084298;
}

.resource-tools-password .alert-info ul {
    padding-left: 1.25rem;
    margin-bottom: 0;
}

.resource-tools-password .alert-info li {
    margin-bottom: 0.25rem;
}

/* Copy Success Animation */
@keyframes copySuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.ccm-copy-password-btn.copied {
    animation: copySuccess 0.3s ease;
    background-color: #198754 !important;
    color: white !important;
    border-color: #198754 !important;
}

/* Progress bar container */
.resource-tools-password .progress:not(.ccm-strength-progress) {
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
}

/* Card styling - ensure proper borders */
.resource-tools-password .card {
    border: 1px solid #dee2e6;
    background-color: white;
}

.resource-tools-password .card-body {
    padding: 1.5rem;
    background-color: white;
}

/* Input group styling */
.resource-tools-password .input-group {
    border: 2px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
}

.resource-tools-password .input-group .ccm-password-output {
    border: none !important;
    border-right: 2px solid #dee2e6 !important;
}

.resource-tools-password .input-group .ccm-copy-password-btn {
    border: none;
    border-radius: 0;
}

/* Range slider styling for better visibility */
.resource-tools-password input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #dee2e6;
    border-radius: 5px;
    outline: none;
}

.resource-tools-password input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #0d6efd;
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.resource-tools-password input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #0d6efd;
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.resource-tools-password input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    background: #dee2e6;
    border-radius: 5px;
}

.resource-tools-password input[type="range"]::-moz-range-track {
    width: 100%;
    height: 8px;
    background: #dee2e6;
    border-radius: 5px;
}

/* Focus States for Accessibility */
.resource-tools-password .form-check-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.resource-tools-password input[type="range"]:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Loading State */
.ccm-password-form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive Adjustments */
@media (max-width: 576px) {
    .ccm-stat-box strong {
        font-size: 1rem;
    }
    
    .ccm-stat-box small {
        font-size: 0.7rem;
    }
    
    .ccm-password-output {
        font-size: 12px;
    }
}

/* Ensure text is readable */
.resource-tools-password label,
.resource-tools-password small,
.resource-tools-password .form-label {
    color: #212529;
}

/* Make sure background colors don't blend */
.resource-tools-password .bg-light {
    background-color: #f8f9fa !important;
}
