/* British Date Formatter Styles */

.british-date-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.british-date-wrapper input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    padding-right: 2.5rem; /* Space for calendar icon */
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #374151;
    background-color: #ffffff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.british-date-wrapper input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.british-date-wrapper input[type="text"]:invalid,
.british-date-wrapper input[type="text"][style*="border-color: rgb(239, 68, 68)"] {
    border-color: #ef4444;
}

.british-date-wrapper input[type="text"]:invalid:focus,
.british-date-wrapper input[type="text"][style*="border-color: rgb(239, 68, 68)"]:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.british-date-wrapper input[type="text"]::placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* Calendar icon styling */
.british-date-wrapper span {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 16px;
    color: #6b7280;
    user-select: none;
}

/* Error message styling */
.date-format-error {
    color: #ef4444 !important;
    font-size: 0.875rem !important;
    margin-top: 0.25rem !important;
    display: block !important;
    font-weight: 400;
}

/* Form group error state */
.form-group.error .british-date-wrapper input[type="text"] {
    border-color: #ef4444;
}

.form-group.error .british-date-wrapper input[type="text"]:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .british-date-wrapper input[type="text"] {
        padding: 0.625rem;
        padding-right: 2.25rem;
        font-size: 0.9rem;
    }
    
    .british-date-wrapper span {
        right: 6px;
        font-size: 14px;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .british-date-wrapper input[type="text"] {
        background-color: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .british-date-wrapper input[type="text"]:focus {
        border-color: #60a5fa;
        box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
    }
    
    .british-date-wrapper input[type="text"]::placeholder {
        color: #6b7280;
    }
    
    .british-date-wrapper span {
        color: #9ca3af;
    }
}

/* Animation for smooth transitions */
.british-date-wrapper input[type="text"] {
    transition: all 0.2s ease-in-out;
}

/* Hover effects */
.british-date-wrapper:hover input[type="text"]:not(:focus) {
    border-color: #9ca3af;
}

/* Disabled state */
.british-date-wrapper input[type="text"]:disabled {
    background-color: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
    opacity: 0.6;
}

.british-date-wrapper input[type="text"]:disabled + span {
    color: #9ca3af;
    opacity: 0.6;
}

/* Success state (when date is valid) */
.british-date-wrapper.valid input[type="text"] {
    border-color: #10b981;
}

.british-date-wrapper.valid input[type="text"]:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Loading state */
.british-date-wrapper.loading input[type="text"] {
    background-image: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Accessibility improvements */
.british-date-wrapper input[type="text"]:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .british-date-wrapper input[type="text"] {
        border-width: 2px;
    }
    
    .british-date-wrapper input[type="text"]:focus {
        border-width: 3px;
    }
}

/* Print styles */
@media print {
    .british-date-wrapper span {
        display: none;
    }
    
    .british-date-wrapper input[type="text"] {
        border: 1px solid #000;
        background: transparent;
        padding-right: 0.75rem;
    }
}