/* XKCD Password Generator Styles */

.pwgen-container {
    margin: 30px 0;
}

/* Responsive design */

.controls {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.control-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    width: 100%;
}

.control-group:last-child {
    margin-bottom: 20px;
}

.control-group label {
    margin-bottom: 0;
    margin-right: 15px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    flex: 1;
}

/* Add this new rule right after the above rule */
.control-group.dropdown-group label {
    flex: none;  /* Override the flex: 1 from the general label rule */
    margin-right: 15px;
}

.control-group.checkbox-group {
    justify-content: flex-start;
}

.control-group.dropdown-group {
    justify-content: flex-start;
    gap: 15px;
}

/* Indented controls */
.control-group.indented,
.separator-options,
.terminator-options {
    margin-left: 25px;
}

.separator-options,
.terminator-options {
    border-left: 3px solid #007cba;
    padding-left: 15px;
    margin-top: 10px;
    margin-bottom: 15px;
}

.separator-options .control-group,
.terminator-options .control-group {
    margin-bottom: 8px;
}

.separator-options .control-group:last-child,
.terminator-options .control-group:last-child {
    margin-bottom: 0;
}

/* Ensure select elements behave properly */
.control-group.dropdown-group select {
    flex-shrink: 0;
}

.control-group input[type="checkbox"] {
    margin-right: 8px;
    margin-left: 0;
    flex-shrink: 0;
}

.control-group input[type="checkbox"] + label {
    display: flex;
    align-items: center;
    margin-left: 0;
    margin-right: 0;
    font-weight: normal;
    flex: 1;
}

.control-group select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    min-width: 140px;
    flex-shrink: 0;
}

.password-list {
    margin-top: 20px;
}

.password-item {
    display: flex;
    align-items: center;
    margin: 12px 0;
    padding: 15px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
}

.password-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.password-text {
    flex-grow: 1;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    word-break: break-all;
    padding: 5px 0;
}

.copy-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 15px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #005a87;
}

.copy-btn.copied {
    background: #28a745;
}

.copy-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.generate-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.2s ease;
    margin-top: 5px;
    width: 100%;
}

.generate-btn:hover {
    background: #1e7e34;
}

.generate-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-style: italic;
}

.api-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
}

.api-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.api-status.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    display: block;
}

.api-status.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

.api-retry {
    text-align: center;
    margin-top: 10px;
}

.retry-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.retry-btn:hover {
    background: #005a87;
}

.retry-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .control-group {
        display: block;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .control-group.indented,
    .separator-options,
    .terminator-options {
        margin-left: 15px;
    }
    
    .separator-options,
    .terminator-options {
        padding-left: 10px;
    }
    
    .password-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .password-text {
        margin-bottom: 10px;
        text-align: center;
    }
    
    .copy-btn {
        margin-left: 0;
        align-self: center;
    }
}

/* Dark mode support (if your Hugo theme supports it) */
@media (prefers-color-scheme: dark) {
    .controls {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .control-group label {
        color: #e2e8f0;
    }
    
    .control-group select {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .control-group input[type="checkbox"] {
        background-color: #4a5568;
        border: 1px solid #718096;
        appearance: none;
        width: 16px;
        height: 16px;
        border-radius: 3px;
        position: relative;
        cursor: pointer;
    }
    
    .control-group input[type="checkbox"]:checked {
        background-color: #007cba;
        border-color: #007cba;
    }
    
    .control-group input[type="checkbox"]:checked::after {
        content: '✓';
        position: absolute;
        top: -1px;
        left: 2px;
        color: white;
        font-size: 12px;
        font-weight: bold;
    }
    
    .control-group input[type="checkbox"]:hover {
        border-color: #007cba;
    }
    
    .separator-options,
    .terminator-options {
        border-left-color: #4299e1;
    }
    
    .password-item {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .password-text {
        color: #e2e8f0;
    }
}