/* Encryption-related styling for DevBrain */

/* Password Modal Styling */
#passwordModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: none;
    align-items: center;
    justify-content: center;
}

#passwordModal.show {
    display: flex;
}

#passwordModal .modal-dialog {
    max-width: 500px;
    width: 90%;
    margin: 0;
}

#passwordModal .modal-content {
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    background: white;
    overflow: hidden;
}

#passwordModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: none;
}

#passwordModal .modal-header .close {
    color: white;
    opacity: 0.8;
    text-shadow: none;
    font-size: 1.5rem;
}

#passwordModal .modal-header .close:hover {
    opacity: 1;
}

#passwordModal .modal-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

#passwordModal .modal-body {
    padding: 2rem 1.5rem;
    background: #fafafa;
}

#passwordModal .form-group label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

#passwordModal #passwordInput {
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

#passwordModal #passwordInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

#passwordModal #passwordError {
    font-size: 0.875rem;
    font-weight: 500;
}

#passwordModal #decryptionProgress {
    background: #f3f4f6;
    border-radius: 6px;
    padding: 1rem;
    border-left: 4px solid #667eea;
}

#passwordModal #decryptionProgress .fas {
    color: #667eea;
}

#passwordModal .modal-footer {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    padding: 1rem 1.5rem;
}

#passwordModal #decryptButton {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    font-weight: 500;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

#passwordModal #decryptButton:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#passwordModal #decryptButton:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#passwordModal .btn-secondary {
    background: #6b7280;
    border: none;
    color: white;
}

#passwordModal .btn-secondary:hover {
    background: #4b5563;
}

/* Encrypted content indicator */
.encrypted-content-indicator {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #92400e;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border-left: 4px solid #d97706;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.encrypted-content-indicator .fas {
    font-size: 1.25rem;
}

.encrypted-content-indicator button {
    background: #92400e;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-left: auto;
}

.encrypted-content-indicator button:hover {
    background: #7c2d12;
}

/* Success state for decrypted content */
.decrypted-content {
    border: 2px solid #10b981;
    border-radius: 8px;
    padding: 1rem;
    background: #f0fdf4;
    position: relative;
    transition: all 0.8s ease-in-out;
}

.decrypted-content::before {
    content: "🔓 Decrypted Content";
    position: absolute;
    top: -12px;
    left: 1rem;
    background: #10b981;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: opacity 0.8s ease-in-out;
}

/* Fade-out state for decrypted content */
.decrypted-content.fade-out {
    border: 2px solid transparent;
    background: transparent;
    /* Keep padding to prevent text movement */
}

.decrypted-content.fade-out::before {
    opacity: 0;
}

/* Loading states */
.decryption-loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.decryption-loading .fas {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #667eea;
}

/* Error states */
.decryption-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 1rem;
    color: #dc2626;
    margin: 1rem 0;
}

.decryption-error .fas {
    margin-right: 0.5rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #passwordModal .modal-dialog {
        margin: 1rem;
        max-width: none;
    }
    
    #passwordModal .modal-body {
        padding: 1.5rem 1rem;
    }
    
    #passwordModal .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #passwordModal .modal-footer .btn {
        width: 100%;
    }
}

/* Animation for modal appearance */
#passwordModal {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#passwordModal.show {
    opacity: 1;
}

#passwordModal .modal-content {
    transform: translateY(-50px) scale(0.95);
    transition: transform 0.3s ease;
}

#passwordModal.show .modal-content {
    transform: translateY(0) scale(1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Focus styles for accessibility */
#passwordModal *:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}
