/* Responsive Design & Accessibility Enhancements */
/* Prompts for Professionals Website */

/* ===== RESPONSIVE DESIGN ===== */

/* Base responsive typography */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 20px;
    }
    
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 992px) {
    .hero-title {
        font-size: 2.2rem;
    }
    
    .sidebar {
        margin-top: 2rem;
    }
    
    .content-card {
        margin-bottom: 1.5rem;
    }
    
    .faq-section .col-lg-10 {
        max-width: 100%;
        flex: 0 0 100%;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .btn-lg {
        font-size: 1rem;
        padding: 12px 24px;
    }
    
    .breadcrumb {
        font-size: 0.875rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
    
    .sidebar-card {
        margin-bottom: 1rem;
    }
    
    .related-keywords {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .related-keyword-item {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 0;
    }
    
    .resources-grid {
        grid-template-columns: 1fr;
    }
    
    .faq-list {
        gap: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 1.5rem;
    }
    
    .profession-badge-large {
        font-size: 0.875rem;
        padding: 4px 12px;
    }
    
    .btn-lg {
        font-size: 0.9rem;
        padding: 10px 20px;
        width: 100%;
    }
    
    .hero-actions {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .breadcrumb {
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .related-keyword-item {
        flex: 1 1 100%;
    }
    
    .share-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .share-btn {
        width: 100%;
        justify-content: center;
    }
    
    .quick-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */

/* Focus indicators */
*:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #0d6efd;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-to-main:focus {
    top: 6px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Color contrast improvements */
.text-muted {
    color: #495057 !important;
}

.card-text, .ai-content, .how-to-use {
    color: #212529;
    line-height: 1.6;
}

/* Link improvements */
a {
    color: #0d6efd;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover, a:focus {
    color: #0a58ca;
    text-decoration-thickness: 2px;
}

a.btn {
    text-decoration: none;
}

/* Form accessibility */
input, select, textarea {
    border: 2px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 16px;
    transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

/* Button accessibility */
.btn {
    border: 2px solid transparent;
    transition: all 0.2s;
}

.btn:focus {
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #0a58ca;
    border-color: #0a58ca;
}

/* Table accessibility */
table {
    border-collapse: collapse;
    width: 100%;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #212529;
}

/* Image accessibility */
img {
    max-width: 100%;
    height: auto;
}

img[alt] {
    font-style: italic;
    color: #6c757d;
}

/* Heading hierarchy */
h1 { font-size: 2rem; margin: 1.5rem 0 1rem; }
h2 { font-size: 1.5rem; margin: 1.25rem 0 0.75rem; }
h3 { font-size: 1.25rem; margin: 1rem 0 0.5rem; }
h4 { font-size: 1.125rem; margin: 0.875rem 0 0.5rem; }
h5 { font-size: 1rem; margin: 0.75rem 0 0.25rem; }
h6 { font-size: 0.875rem; margin: 0.625rem 0 0.25rem; }

/* List accessibility */
ul, ol {
    padding-left: 2rem;
    margin: 1rem 0;
}

li {
    margin-bottom: 0.5rem;
}

/* Code accessibility */
code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #d63384;
}

pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
}

pre code {
    background: none;
    padding: 0;
    color: #212529;
}

/* Blockquote accessibility */
blockquote {
    border-left: 4px solid #0d6efd;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #495057;
}

/* Alert accessibility */
.alert {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffecb5;
    color: #664d03;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #721c24;
}

.alert-info {
    background-color: #cff4fc;
    border-color: #b6effb;
    color: #055160;
}

/* Navigation accessibility */
.navbar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.navbar-brand {
    font-weight: 600;
    color: #212529 !important;
}

.nav-link {
    color: #495057 !important;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link:focus {
    color: #212529 !important;
    background-color: #e9ecef;
}

/* Footer accessibility */
footer {
    background-color: #343a40;
    color: #f8f9fa;
    padding: 2rem 0;
}

footer a {
    color: #f8f9fa;
}

footer a:hover, footer a:focus {
    color: #adb5bd;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .container {
        max-width: none;
        width: 100%;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #6c757d;
    }
    
    .btn, .sidebar, .share-buttons {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --bs-primary: #0000ff;
        --bs-secondary: #666666;
        --bs-success: #008000;
        --bs-info: #0000ff;
        --bs-warning: #ff8c00;
        --bs-danger: #ff0000;
        --bs-light: #ffffff;
        --bs-dark: #000000;
    }
    
    .btn {
        border-width: 2px;
    }
    
    a {
        text-decoration-thickness: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #2d3748;
        border-color: #4a5568;
    }
    
    .card-header {
        background-color: #4a5568;
        border-color: #718096;
    }
    
    .text-muted {
        color: #a0aec0 !important;
    }
    
    body {
        background-color: #1a202c;
        color: #e2e8f0;
    }
}

/* Touch target improvements for mobile */
@media (pointer: coarse) {
    .btn, .nav-link, .related-keyword-item, .share-btn, .action-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 12px;
    }
    
    .related-keyword-item {
        padding: 12px 16px;
    }
}

/* Keyboard navigation improvements */
.keyboard-nav *:focus {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
}

/* 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 #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error states */
.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25) !important;
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Success states */
.success {
    border-color: #198754 !important;
    box-shadow: 0 0 0 2px rgba(25, 135, 84, 0.25) !important;
}

/* Responsive grid improvements */
.responsive-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Responsive images */
.responsive-img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Responsive typography */
.responsive-text {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    line-height: 1.6;
}

/* Responsive spacing */
.responsive-spacing {
    padding: clamp(1rem, 5vw, 3rem);
}
