/* Custom styles for Asset of Things application */

/* Ensure Syncfusion buttons display properly */
.e-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 36px !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
    transition: all 0.2s ease-in-out !important;
}

/* Button content visibility */
.e-btn .e-btn-content {
    display: block !important;
    color: inherit !important;
}

/* Primary button styling */
.e-btn.e-primary,
.e-btn.bg-blue-600 {
    background-color: #2563eb !important;
    color: white !important;
    border: 1px solid #2563eb !important;
}

.e-btn.e-primary:hover,
.e-btn.bg-blue-600:hover {
    background-color: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
}

/* Secondary/text button styling */
.e-btn.text-blue-600 {
    background-color: transparent !important;
    color: #2563eb !important;
    border: none !important;
}

.e-btn.text-blue-600:hover {
    color: #1d4ed8 !important;
    background-color: rgba(37, 99, 235, 0.05) !important;
}

/* Disabled button styling */
.e-btn:disabled,
.e-btn.e-disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

/* Loading spinner animation */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Form styling improvements */
.e-input-group {
    width: 100% !important;
}

.e-input-group .e-input {
    padding: 12px 16px !important;
    border-radius: 6px !important;
    border: 1px solid #d1d5db !important;
    font-size: 14px !important;
}

.e-input-group .e-input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
    outline: none !important;
}

/* Toast notification styling */
.e-toast-success {
    background-color: #10b981 !important;
    color: white !important;
}

.e-toast-danger {
    background-color: #ef4444 !important;
    color: white !important;
}

.e-toast-warning {
    background-color: #f59e0b !important;
    color: white !important;
}

/* Public layout specific styles */
.public-layout {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.public-layout header {
    border-bottom: 1px solid #e5e7eb;
}

.public-layout footer {
    border-top: 1px solid #e5e7eb;
    background-color: #ffffff;
}

/* Password field toggle button */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
}

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

/* Success/Error icons */
.status-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.status-icon.success {
    background-color: #d1fae5;
    color: #10b981;
}

.status-icon.error {
    background-color: #fee2e2;
    color: #ef4444;
}

/* Card/container styling */
.password-reset-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    padding: 32px;
    max-width: 400px;
    width: 100%;
}

/* Form styling system */
/* Form Labels */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.form-label-required::after {
    content: " *";
    color: #ef4444;
    font-weight: 400;
}

/* Form Values (read-only display) */
.form-value {
    font-size: 0.875rem;
    color: #111827;
    margin-top: 0.25rem;
    font-weight: 400;
}

.form-value-empty {
    font-size: 0.875rem;
    color: #9ca3af;
    font-style: italic;
    margin-top: 0.25rem;
}

/* Form Inputs - Enhanced Syncfusion styling */
.form-input .e-input,
.form-input .e-dropdown,
.form-input .e-numerictextbox {
    width: 100%;
    padding: 0.625rem 0.875rem !important;
    border: 1px solid #d1d5db !important;
    border-radius: 0.375rem !important;
    font-size: 0.875rem !important;
    transition: all 0.15s ease-in-out !important;
}

.form-input .e-input:focus,
.form-input .e-dropdown:focus,
.form-input .e-numerictextbox:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    outline: none !important;
}

.form-input-error .e-input,
.form-input-error .e-dropdown {
    border-color: #ef4444 !important;
}

.form-input-error .e-input:focus,
.form-input-error .e-dropdown:focus {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Form Sections */
.form-section {
    grid-column: 1 / -1;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.form-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* Form Grid Layout */
.form-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

@media (min-width: 1024px) {
    .form-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

/* Column spanning utilities */
.col-span-1 { grid-column: span 1; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }
.col-span-full { grid-column: 1 / -1; }

@media (max-width: 767px) {
    .col-span-2,
    .col-span-3,
    .col-span-4 {
        grid-column: span 1;
    }
}

/* Validation styling */
.validation-message {
    color: #dc2626;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: block;
}

.validation-success {
    color: #059669;
}

/* Dialog enhancements */
.e-dialog .e-dlg-content {
    max-height: 70vh;
    overflow-y: auto;
    padding: 1.5rem !important;
}

/* Asset Editor Dialog - Enhanced border styling */
.e-dialog {
    border: 3px solid #3b82f6 !important; /* Bright blue border */
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3), 
                0 10px 25px rgba(0, 0, 0, 0.15) !important; /* Blue glow + shadow */
    border-radius: 0.5rem !important;
}

/* Dark mode support for dialog border */
.dark .e-dialog {
    border: 3px solid #60a5fa !important; /* Lighter blue for dark mode */
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.4), 
                0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

/* Dialog header enhanced styling */
.e-dialog .e-dlg-header {
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
    color: white !important;
    border-bottom: 2px solid #3b82f6;
    padding: 1rem 1.25rem !important;
}

.dark .e-dialog .e-dlg-header {
    background: linear-gradient(90deg, #1e40af 0%, #1e3a8a 100%);
    border-bottom: 2px solid #60a5fa;
}

/* Ensure header text and icons are white */
.e-dialog .e-dlg-header * {
    color: white !important;
}

/* Checkbox and radio button styling */
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
}

/* Improved Syncfusion dropdown styling */
.e-ddl.e-input-group {
    border-radius: 0.375rem !important;
}

.e-ddl .e-input-filter-parent {
    border-radius: 0.375rem !important;
}

/* Card styling for form sections */
.form-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.form-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

/* Search validation styles */
.search-invalid input,
.search-invalid .e-textbox,
.search-invalid .e-input {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.search-invalid .e-input-group,
.search-invalid .e-input-group-icon {
    border-color: #dc3545 !important;
}

.search-invalid .e-clear-icon::before {
    color: #dc3545 !important;
}

/* Force red text color in Syncfusion textbox */
.search-container.search-invalid input[type="text"] {
    color: #dc3545 !important;
}

/* Make placeholder red when error is active */
.search-container.search-error-active input::placeholder {
    color: #dc3545 !important;
    font-weight: 600;
    animation: shake 0.5s;
}

/* Shake animation for error notification */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.search-container.search-error-active .e-input-group {
    border-color: #dc3545 !important;
    border-width: 2px !important;
    animation: pulse-border 1s ease-in-out;
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    50% { box-shadow: 0 0 0 5px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

.search-validation-error {
    color: #dc3545;
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    position: absolute;
    white-space: nowrap;
    z-index: 1000;
    background: #fff5f5;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #dc3545;
    box-shadow: 0 4px 6px rgba(220, 53, 69, 0.2);
    animation: slideDown 0.3s ease-out;
}

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

.dark .search-validation-error {
    background: #1f2937;
    color: #ef4444;
}

.search-validation-error i {
    font-size: 0.875rem;
}

.search-container {
    position: relative;
}

/* Asset Editor Accordion and DataForm Compact Styling */
/* Reduce accordion content padding */
.asset-editor-container .e-accordion .e-acrdn-content {
    padding: 0.5rem !important; /* Reduced from default ~24px to 8px */
}

/* Reduce dataform padding and margins */
.asset-editor-container .e-data-form {
    padding: 0 !important;
    margin: 0 !important;
}

/* Reduce form group spacing */
.asset-editor-container .e-form-group {
    margin-bottom: 0.75rem !important; /* Reduced from default */
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Additional specificity for form groups with our custom classes */
.asset-editor-container .details-info.e-form-group,
.asset-editor-container .location-info.e-form-group,
.asset-editor-container .officeonly-info.e-form-group {
    padding: 0.5rem !important; /* Override any existing padding */
    margin-bottom: 0.75rem !important;
    margin-top: 0 !important;
}

/* Reduce form item spacing */
.asset-editor-container .e-form-item {
    margin-bottom: 0.5rem !important; /* Reduced from default */
    padding: 0 !important;
}

/* Reduce label spacing */
.asset-editor-container .e-form-label {
    margin-bottom: 0.25rem !important; /* Reduced spacing below labels */
    padding: 0 !important;
}

/* Tighten input group spacing */
.asset-editor-container .e-input-group {
    margin-bottom: 0.25rem !important;
}

/* Remove excess padding from form containers */
.asset-editor-container .e-form-container {
    padding: 0 !important;
}

/* Asset Editor Accordion Header Styling */
.asset-editor-container .e-accordion .e-acrdn-header {
    padding: 0.75rem 1rem !important; /* Slightly reduced header padding */
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    font-weight: 500;
}

.asset-editor-container .e-accordion .e-acrdn-header:hover {
    background: linear-gradient(to right, #eff6ff, #dbeafe);
    border-color: #93c5fd;
}

.asset-editor-container .e-accordion .e-acrdn-header.e-select,
.asset-editor-container .e-accordion .e-acrdn-header.e-active {
    background: linear-gradient(to right, #dbeafe, #bfdbfe);
    border-color: #3b82f6;
    box-shadow: 0 1px 3px 0 rgba(59, 130, 246, 0.1);
}

/* Dark mode accordion styling */
.dark .asset-editor-container .e-accordion .e-acrdn-header {
    background: linear-gradient(to right, #1f2937, #374151);
    border-color: #4b5563;
    color: #f3f4f6;
}

.dark .asset-editor-container .e-accordion .e-acrdn-header:hover {
    background: linear-gradient(to right, #374151, #4b5563);
    border-color: #6b7280;
}

.dark .asset-editor-container .e-accordion .e-acrdn-header.e-select,
.dark .asset-editor-container .e-accordion .e-acrdn-header.e-active {
    background: linear-gradient(to right, #1e3a8a, #1e40af);
    border-color: #3b82f6;
}

/* Accordion icon styling */
.asset-editor-container .e-accordion .e-acrdn-header .e-acrdn-header-icon {
    color: #3b82f6;
}

/* Ensure form groups stack tightly */
.asset-editor-container .details-info,
.asset-editor-container .location-info,
.asset-editor-container .officeonly-info {
    padding: 0 !important;
    margin: 0 !important;
}

/* Row spacing within forms */
.asset-editor-container .e-form-group .e-form-row {
    margin-bottom: 0.5rem !important;
    gap: 0.5rem !important;
}

/* Reduce spacing between form sections */
.asset-editor-container .e-form-group + .e-form-group {
    margin-top: 0.5rem !important;
}

/* Asset editor content wrapper tighter spacing */
.asset-editor-content {
    padding: 1rem !important;
}

/* Remove any extra spacing from Syncfusion form field containers */
.asset-editor-container .e-field-container {
    margin-bottom: 0.5rem !important;
}

/* Target the specific accordion content template areas */
.asset-editor-container .e-accordion .e-content .e-acrdn-panel {
    padding: 0 !important;
}

/* Ensure the DataForm doesn't add extra top padding */
.asset-editor-container .e-form {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Target form items within specific groups */
.asset-editor-container .e-form-group.details-info .e-form-item,
.asset-editor-container .e-form-group.location-info .e-form-item,
.asset-editor-container .e-form-group.officeonly-info .e-form-item {
    padding: 0 !important;
    margin-bottom: 0.4rem !important;
}

/* Additional override for any Syncfusion default spacing */
.asset-editor-container .e-acrdn-content > div {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Ensure no extra spacing at the top of accordion content */
.asset-editor-container .e-acrdn-content > .e-data-form:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Handle any wrapper divs that might add spacing */
.asset-editor-container .e-acrdn-content > div:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .password-reset-card {
        padding: 24px;
        margin: 16px;
    }
    
    .e-btn {
        min-height: 44px !important;
        padding: 12px 16px !important;
    }
    
    .e-dialog {
        width: 95% !important;
        margin: 0 auto !important;
    }
    
    .form-section-title {
        font-size: 1rem;
    }
}

/* Customer Details Styling */
.customer-details-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
}

.customer-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.customer-icon {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.75rem;
    border-radius: 0.5rem;
}

.customer-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.customer-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    opacity: 0.9;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Tab Content Styling */
.tab-content {
    padding: 1.5rem;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.tab-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.refresh-btn {
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.refresh-btn:hover {
    background-color: #e5e7eb;
    transform: rotate(180deg);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-active {
    background-color: #d1fae5;
    color: #065f46;
}

.status-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Address Styling */
.address-same-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    color: #6b7280;
}

.location-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background-color: #f9fafb;
    border: 2px dashed #e5e7eb;
    border-radius: 0.5rem;
    text-align: center;
}

/* Customer Details Responsive */
@media (max-width: 768px) {
    .customer-details-header {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .customer-info {
        flex-direction: column;
        text-align: center;
    }
    
    .customer-meta {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
    }
}