/* SEBI Digital Accessibility Compliance Styles */
/* As per WCAG 2.1 Level AA Standards */

/* Skip to main content link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px 15px;
    text-decoration: none;
    z-index: 100000;
    font-weight: bold;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #fff;
}

/* Enhanced focus indicators for keyboard navigation */
*:focus {
    outline: 2px solid #007DC5;
    outline-offset: 2px;
}

button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 3px solid #007DC5;
    outline-offset: 2px;
}

/* Remove focus outline for mouse users (but keep for keyboard) */
*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 3px solid #007DC5;
    outline-offset: 2px;
}

/* Accessible button styles */
button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* External link indicator for screen readers */
a[target="_blank"]::after {
    content: " (opens in new window)";
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Visual indicator for external links */
a[target="_blank"] {
    position: relative;
}

/* Accessible modal styles */
.modal[aria-modal="true"] {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    * {
        border-color: currentColor !important;
    }
}

/* Reduced motion support for users with vestibular disorders */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Ensure minimum touch target size of 44x44 pixels */
button,
a,
input[type="checkbox"],
input[type="radio"] {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Exception for text links within paragraphs */
p a {
    min-width: auto;
    min-height: auto;
    display: inline;
}

/* Accessible table styles */
table {
    border-collapse: collapse;
    width: 100%;
}

th {
    text-align: left;
    font-weight: bold;
}

/* Focus trap for modals */
.modal-open {
    overflow: hidden;
}

/* Accessible form labels */
label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

input:required + label::after,
select:required + label::after {
    content: " *";
    color: #d00;
}

/* Error message styling */
.error-message {
    color: #d00;
    font-weight: bold;
    margin-top: 5px;
}

[aria-invalid="true"] {
    border: 2px solid #d00;
}

/* Accessible loading indicators */
[aria-busy="true"] {
    cursor: wait;
}

/* Live region announcements */
[aria-live="polite"],
[aria-live="assertive"] {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Ensure color is not the only indicator */
.required::before {
    content: "* ";
    color: #d00;
}

.required::after {
    content: " (required)";
    font-size: 0.9em;
    color: #666;
}

/* Accessible alternative to marquee */
.scrolling-text {
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
}

.scrolling-text span {
    display: inline-block;
    padding-left: 100%;
    animation: scroll-left 60s linear infinite;
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Pause animation on hover/focus for accessibility */
.scrolling-text:hover span,
.scrolling-text:focus-within span {
    animation-play-state: paused;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    .scrolling-text span {
        animation: none;
        padding-left: 0;
    }
}
