/* Custom styles for VaultIQ */

/* Force black text in all input fields */
input[type="text"],
input[type="email"], 
input[type="password"],
input[type="number"],
input[type="date"],
input[type="url"],
textarea,
select {
    color: #000000 !important;
}

/* Ensure placeholder text is visible but lighter */
input::placeholder,
textarea::placeholder {
    color: #6b7280 !important;
}

/* Navigation Enhancements */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.nav-link:hover::before {
    left: 100%;
}

/* Mobile navigation improvements */
.mobile-nav-link {
    position: relative;
    border-radius: 0.5rem;
}

.mobile-nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transition: width 0.3s ease;
}

.mobile-nav-link:hover::after {
    width: 100%;
}

/* Dropdown animation improvements */
.group:hover .group-hover\:opacity-100 {
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Active navigation state */
.nav-link.active,
.mobile-nav-link.active {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white !important;
}

.nav-link.active i,
.mobile-nav-link.active i {
    color: white !important;
}

/* Smooth transitions for all interactive elements */
.nav-link,
.mobile-nav-link,
button {
    transition: all 0.2s ease-in-out;
}

/* Enhanced focus states for accessibility */
.nav-link:focus,
.mobile-nav-link:focus,
button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Improved gradient text */
.bg-gradient-to-r.from-blue-600.to-purple-600.bg-clip-text.text-transparent {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Password visibility toggle */
.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #374151;
}

/* Passcode input styling */
input[name="passcode"] {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5em;
    text-align: center;
}

/* Credential cards hover effects */
.credential-card {
    transition: all 0.2s ease-in-out;
}

.credential-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Category badges */
.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #dbeafe;
}

/* Password strength indicator */
.password-strength {
    height: 4px;
    border-radius: 2px;
    background-color: #e5e7eb;
    overflow: hidden;
    margin-top: 4px;
}

.password-strength-fill {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-weak {
    background-color: #ef4444;
}

.strength-medium {
    background-color: #f59e0b;
}

.strength-strong {
    background-color: #10b981;
}

/* Form animations */
.form-slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal animations */
.modal-backdrop {
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    animation: scaleIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Success message for revealed passwords */
.password-revealed {
    animation: highlight 0.5s ease-out;
    background-color: #dcfce7 !important;
    padding: 2px 4px;
    border-radius: 4px;
}

@keyframes highlight {
    from {
        background-color: #22c55e;
        color: white;
    }
    to {
        background-color: #dcfce7;
        color: inherit;
    }
}

/* Copy button styles */
.copy-button {
    opacity: 0;
    transition: opacity 0.2s;
}

.credential-card:hover .copy-button {
    opacity: 1;
}

/* Mobile responsiveness */
@media (max-width: 640px) {
    .credential-card {
        margin-bottom: 1rem;
    }
    
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
    
    /* Stack form elements on mobile */
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark mode support (if needed in the future) */
@media (prefers-color-scheme: dark) {
    .dark-mode {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .dark-mode .bg-white {
        background-color: #374151;
    }
    
    .dark-mode .text-gray-900 {
        color: #f9fafb;
    }
    
    .dark-mode .border-gray-300 {
        border-color: #4b5563;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .credential-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Focus styles for accessibility */
.focus-ring:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #1f2937;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.75rem;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Search and filter animations */
.filter-active {
    background-color: #3b82f6;
    color: white;
    transform: scale(1.05);
}

/* Error states */
.field-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
}

.error-message::before {
    content: '⚠';
    margin-right: 0.25rem;
}

/* Success states */
.field-success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
