/* ========================================
   Codetude Password Generator - Estilos
   ======================================== */

:root {
    --pwd-primary: #14b8a6;
    --pwd-success: #10b981;
    --pwd-danger: #ef4444;
    --pwd-warning: #f59e0b;
    --pwd-light-bg: #ffffff;
    --pwd-light-surface: #f8fafc;
    --pwd-light-border: #e2e8f0;
    --pwd-light-text: #1e293b;
    --pwd-light-text-secondary: #64748b;
    --pwd-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dark-mode {
    --pwd-light-bg: #1e293b;
    --pwd-light-surface: #0f172a;
    --pwd-light-border: #334155;
    --pwd-light-text: #e2e8f0;
    --pwd-light-text-secondary: #94a3b8;
    --pwd-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* Container */
.codetude-password-generator {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Seções */
.password-section {
    background: var(--pwd-light-bg);
    border: 1px solid var(--pwd-light-border);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--pwd-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.password-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Headers */
.section-header {
    margin-bottom: 25px;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: var(--pwd-light-text);
    margin: 0 0 10px 0;
}

.section-header h2 .icon {
    width: 28px;
    height: 28px;
    color: var(--pwd-primary);
    stroke-width: 2;
}

.section-description {
    color: var(--pwd-light-text-secondary);
    margin: 0;
    font-size: 15px;
}

/* Controles */
.generator-controls {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Length Control */
.length-control {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.length-control label {
    font-size: 16px;
    font-weight: 600;
    color: var(--pwd-light-text);
}

#length-value {
    color: var(--pwd-primary);
    font-weight: 700;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: var(--pwd-light-border);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--pwd-primary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.4);
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.6);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--pwd-primary);
    cursor: pointer;
    border: none;
}

.length-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--pwd-light-text-secondary);
}

/* Options Group */
.options-group h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--pwd-light-text);
    margin: 0 0 15px 0;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.checkbox-card {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.checkbox-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    background: var(--pwd-light-surface);
    border: 2px solid var(--pwd-light-border);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.checkbox-card input:checked + .card-content {
    background: var(--pwd-primary);
    border-color: var(--pwd-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.checkbox-card input:checked + .card-content .card-icon,
.checkbox-card input:checked + .card-content .card-label,
.checkbox-card input:checked + .card-content .card-example {
    color: white;
}

.card-icon {
    font-size: 24px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--pwd-primary);
    margin-bottom: 8px;
}

.card-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--pwd-light-text);
    margin-bottom: 4px;
}

.card-example {
    font-size: 11px;
    color: var(--pwd-light-text-secondary);
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn .icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.btn-primary {
    background: var(--pwd-primary);
    color: white;
}

.btn-primary:hover {
    background: #0d9488;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.4);
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
    width: 100%;
}

.btn-secondary {
    background: var(--pwd-light-surface);
    color: var(--pwd-light-text);
    border: 1px solid var(--pwd-light-border);
}

.btn-secondary:hover {
    background: var(--pwd-light-border);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* Password Display */
.password-display {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
}

.password-box {
    display: flex;
    gap: 10px;
    position: relative;
}

#password-output {
    flex: 1;
    padding: 16px 60px 16px 20px;
    border: 2px solid var(--pwd-light-border);
    border-radius: 10px;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    background: var(--pwd-light-surface);
    color: var(--pwd-light-text);
    letter-spacing: 1px;
}

#password-output:focus {
    outline: none;
    border-color: var(--pwd-primary);
}

.copy-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px;
    background: var(--pwd-primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn svg {
    width: 20px;
    height: 20px;
    stroke: white;
    stroke-width: 2;
}

.copy-btn:hover {
    background: #0d9488;
    transform: translateY(-50%) scale(1.05);
}

.copy-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* Strength Meter */
.strength-meter {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.strength-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--pwd-light-text);
}

#strength-text {
    color: var(--pwd-primary);
    font-weight: 700;
}

.strength-bar {
    height: 8px;
    background: var(--pwd-light-border);
    border-radius: 4px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 4px;
}

/* Strength Colors */
.strength-very-weak { color: #dc2626 !important; }
.strength-weak { color: #f59e0b !important; }
.strength-medium { color: #3b82f6 !important; }
.strength-strong { color: #10b981 !important; }
.strength-very-strong { color: #059669 !important; }

/* History */
.history-section {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid var(--pwd-light-border);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.history-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--pwd-light-text);
    margin: 0;
}

.password-history {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--pwd-light-surface);
    border: 1px solid var(--pwd-light-border);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--pwd-light-text);
    transition: all 0.2s ease;
    cursor: pointer;
}

.history-item:hover {
    border-color: var(--pwd-primary);
    background: var(--pwd-light-bg);
    transform: translateX(4px);
}

.history-item .copy-icon {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

.history-item:hover .copy-icon {
    opacity: 1;
}

/* Info Cards */
.info-content {
    display: grid;
    gap: 20px;
}

.info-card {
    padding: 20px;
    background: var(--pwd-light-surface);
    border-left: 4px solid var(--pwd-primary);
    border-radius: 8px;
}

.info-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--pwd-light-text);
    margin: 0 0 12px 0;
}

.info-card ul {
    margin: 10px 0;
    padding-left: 25px;
    color: var(--pwd-light-text-secondary);
    line-height: 1.8;
}

.info-card strong {
    color: var(--pwd-light-text);
}

.alert-card {
    border-left-color: var(--pwd-warning);
    background: rgba(245, 158, 11, 0.1);
}

.alert-card p {
    color: var(--pwd-light-text);
    line-height: 1.6;
    margin: 0 0 10px 0;
}

/* Toast */
.password-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--pwd-light-text);
    color: white;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--pwd-shadow);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.password-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Responsivo */
@media (max-width: 768px) {
    .codetude-password-generator {
        padding: 15px;
    }
    
    .password-section {
        padding: 20px;
    }
    
    .options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #password-output {
        font-size: 14px;
        padding: 14px 55px 14px 16px;
    }
    
    .history-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
    }
}