/* Advanced Password Generator - Frontend Styles */

.apg-frontend-container {
    max-width: 800px;
    margin: 20px auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.apg-settings {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.apg-settings h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 24px;
    text-align: center;
}

/* Main controls - two column layout */
.apg-main-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.apg-setting-group {
    margin-bottom: 20px;
}

.apg-setting-group.apg-half-width {
    margin-bottom: 0;
}

.apg-setting-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.apg-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.apg-input-group input[type="range"] {
    flex: 1;
    min-width: 0;
}

.apg-value {
    display: inline-block;
    min-width: 40px;
    padding: 6px 12px;
    background: #007cba;
    color: white;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Collapsible sections */
.apg-collapsible-section {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.apg-toggle-btn {
    width: 100%;
    padding: 12px 16px;
    background: #f8f9fa;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
    position: relative;
    z-index: 1;
    outline: none;
}

.apg-toggle-btn:hover {
    background: #e9ecef;
}

.apg-toggle-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: -2px;
}

.apg-toggle-icon {
    font-size: 12px;
    transition: transform 0.2s;
    color: #666;
}

.apg-toggle-btn.expanded .apg-toggle-icon {
    transform: rotate(180deg);
}

.apg-collapsible-content {
    display: block;
    padding: 16px;
    background: white;
    border-top: 1px solid #eee;
    overflow: hidden;
}

.apg-collapsible-content.collapsed {
    display: none;
}

.apg-collapsible-content.expanded {
    display: block;
}

.apg-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.apg-checkboxes label {
    display: flex;
    align-items: center;
    font-weight: normal;
    margin-bottom: 0;
    cursor: pointer;
    padding: 10px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
}

.apg-checkboxes label:hover {
    background: #e9ecef;
    border-color: #007cba;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.apg-checkboxes input[type="checkbox"] {
    margin-right: 8px;
    margin-bottom: 0;
}

.apg-generate-btn {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 25px auto 0;
    padding: 14px 28px;
    background: linear-gradient(135deg, #007cba, #005a87);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.apg-generate-btn:hover {
    background: linear-gradient(135deg, #005a87, #004368);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.apg-generate-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.apg-generate-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Results section */
.apg-results {
    padding: 20px;
}

.apg-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.apg-results-header h4 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.apg-copy-all-btn {
    padding: 8px 16px;
    background: #46b450;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.apg-copy-all-btn:hover {
    background: #3ba54a;
}

.apg-copy-all-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.apg-password-list {
    min-height: 100px;
}

.apg-empty-state {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
    background: #f9f9f9;
    border: 2px dashed #ddd;
    border-radius: 4px;
}

.apg-password-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    transition: all 0.2s;
}

.apg-password-item:hover {
    background: #e9ecef;
    border-color: #007cba;
}

.apg-password-text {
    flex: 1;
    font-family: 'Courier New', 'Monaco', monospace;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    word-break: break-all;
    margin-right: 15px;
    padding: 8px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.apg-copy-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s;
    white-space: nowrap;
}

.apg-copy-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.apg-copy-btn:active {
    background: #004368;
    transform: translateY(0);
}

.apg-copy-btn.copied {
    background: #46b450;
}

/* Strength indicator */
.apg-strength-indicator {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.apg-strength-indicator h5 {
    margin: 0 0 10px 0;
    color: #333;
}

.apg-strength-bar {
    width: 100%;
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin: 10px 0;
}

.apg-strength-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 5px;
}

.apg-strength-fill.weak {
    background: linear-gradient(90deg, #dc3545, #e74c3c);
}

.apg-strength-fill.medium {
    background: linear-gradient(90deg, #ffc107, #f39c12);
}

.apg-strength-fill.strong {
    background: linear-gradient(90deg, #28a745, #27ae60);
}

.apg-strength-fill.very-strong {
    background: linear-gradient(90deg, #20c997, #16a085);
}

.apg-strength-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.apg-strength-level {
    font-weight: bold;
    font-size: 16px;
}

.apg-strength-level.weak {
    color: #dc3545;
}

.apg-strength-level.medium {
    color: #ffc107;
}

.apg-strength-level.strong {
    color: #28a745;
}

.apg-strength-level.very-strong {
    color: #20c997;
}

.apg-strength-score {
    font-size: 14px;
    color: #666;
}

/* Loading state */
.apg-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.apg-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #007cba;
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: apg-spin 1s linear infinite;
}

@keyframes apg-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast notifications */
.apg-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    background: #333;
    color: white;
    border-radius: 4px;
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.apg-toast.show {
    transform: translateX(0);
}

.apg-toast.success {
    background: #46b450;
}

.apg-toast.error {
    background: #dc3545;
}

/* Responsive design */
@media (max-width: 768px) {
    .apg-frontend-container {
        margin: 10px;
        border-radius: 4px;
    }
    
    .apg-settings,
    .apg-results {
        padding: 15px;
    }
    
    .apg-main-controls {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .apg-checkboxes {
        gap: 6px;
    }
    
    .apg-toggle-btn {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .apg-password-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .apg-password-text {
        margin-right: 0;
        margin-bottom: 10px;
        text-align: center;
        font-size: 14px;
    }
    
    .apg-results-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .apg-copy-all-btn {
        width: 100%;
    }
    
    .apg-strength-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .apg-settings h3 {
        font-size: 20px;
    }
    
    .apg-input-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .apg-input-group input[type="range"] {
        width: 100%;
    }
    
    .apg-value {
        align-self: center;
    }
    
    .apg-password-text {
        font-size: 12px;
        padding: 6px;
    }
    
    .apg-checkboxes {
        gap: 6px;
    }
    
    .apg-checkboxes label {
        padding: 8px 10px;
        font-size: 14px;
    }
}
