/* Custom styles for AI Policy Generator */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    
    /* Design tokens for UI refresh */
    --color-bg: #F7F7F5;
    --color-surface: #FFFFFF;
    --color-text: #111111;
    --color-muted: #5B5B5B;
    --color-border: #E6E6E6;
    --color-accent: #1F4ED8;
    
    /* Focus ring */
    --focus-ring-color: rgba(31, 78, 216, 0.5);
    --focus-ring-width: 3px;
    --focus-ring-offset: 2px;
}

/* ===== Accessibility: Skip to content link ===== */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-accent);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 0.5rem 0.5rem;
    font-weight: 600;
    text-decoration: none;
    z-index: 9999;
    transition: top 0.2s ease-in-out;
}

.skip-link:focus {
    top: 0;
    outline: none;
}

/* ===== Accessibility: Focus-visible ring ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: var(--focus-ring-width) solid var(--focus-ring-color);
    outline-offset: var(--focus-ring-offset);
}

/* Remove default outline when using focus-visible */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
[tabindex]:focus:not(:focus-visible) {
    outline: none;
}

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

/* General improvements */
body {
    line-height: 1.6;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.25rem;
}

/* Form improvements */
.form-floating > label {
    padding-left: 1rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Card enhancements */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Button improvements */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
}

/* Wizard steps */
.wizard-step {
    margin-bottom: 2rem;
}

.wizard-step h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Dashboard improvements */
.policy-card {
    transition: transform 0.2s ease-in-out;
}

.policy-card:hover {
    transform: translateY(-2px);
}

.policy-meta {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

/* Alert improvements */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Footer */
.footer {
    background-color: var(--bs-dark);
    color: var(--bs-light);
    padding: 2rem 0;
    margin-top: 4rem;
}

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

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .btn-lg {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Text improvements */
.text-muted {
    color: var(--secondary-color) !important;
}

/* Hero section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    color: white;
    padding: 4rem 0;
    margin-bottom: 2rem;
}

.hero h1 {
    font-weight: bold;
    margin-bottom: 1rem;
}

.hero p.lead {
    font-size: 1.125rem;
    opacity: 0.9;
}

/* Policy Preview Card (Hero Document Mock) */
.policy-preview-card {
    background: var(--color-surface);
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    max-width: 400px;
    margin: 0 auto;
}

.policy-preview-header {
    background: #e9ecef;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.policy-preview-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #dee2e6;
}

.policy-preview-dot:nth-child(1) { background: #ff5f57; }
.policy-preview-dot:nth-child(2) { background: #febc2e; }
.policy-preview-dot:nth-child(3) { background: #28c840; }

.policy-preview-title {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--color-muted);
    font-weight: 500;
}

.policy-preview-body {
    padding: 1.5rem;
}

.policy-preview-section {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.policy-preview-section:last-child {
    border-bottom: none;
}

@media (max-width: 991.98px) {
    .policy-preview-card {
        max-width: 100%;
    }
}

/* Feature cards */
.feature-card {
    text-align: center;
    padding: 2rem 1rem;
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Policy status badges */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Hash display */
.hash-display {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    word-break: break-all;
    background-color: var(--bs-light);
    padding: 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid var(--bs-border-color);
}

/* Ensure form fields show dark text */
input.form-control,
select.form-control,
select.form-select,
textarea.form-control {
    color: #212529 !important;
    background-color: #ffffff !important;
}

/* Ensure select options are visible */
select.form-select option,
select.form-control option {
    color: #212529 !important;
    background-color: #ffffff !important;
}

/* Style the placeholder option differently */
select.form-select option[value=""],
select.form-control option[value=""] {
    color: #6c757d !important;
    font-style: italic;
}

/* Placeholder text in mid-gray */
input.form-control::placeholder,
textarea.form-control::placeholder {
    color: #6c757d !important;
    opacity: 1 !important;
}

/* Fix floating labels with placeholders */
.form-floating > .form-control::placeholder {
    color: transparent !important;
}

.form-floating > .form-control:focus::placeholder {
    color: #6c757d !important;
    opacity: 0.6 !important;
}

/* Ensure floating labels are visible */
.form-floating > label {
    color: #6c757d !important;
    opacity: 1 !important;
}

/* Policy Preview: light text on dark background */
.policy-preview {
    color: #f8f9fa !important;
    background-color: #343a40 !important;
}

.policy-preview h1,
.policy-preview h2,
.policy-preview h3,
.policy-preview h4,
.policy-preview h5,
.policy-preview h6 {
    color: #ffffff !important;
}

.policy-preview p,
.policy-preview li,
.policy-preview span {
    color: #f8f9fa !important;
}

.policy-preview hr {
    border-color: #6c757d !important;
}

/* Pricing Comparison Table Accessibility & Mobile */
.pricing-comparison-table {
    min-width: 100%;
}

.pricing-comparison-table th[scope="row"] {
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.pricing-comparison-table th[scope="col"] {
    font-weight: 700;
}

@media (max-width: 767.98px) {
    .pricing-comparison-table {
        font-size: 0.875rem;
    }
    
    .pricing-comparison-table th[scope="row"] {
        white-space: normal;
    }
    
    .pricing-comparison-table td,
    .pricing-comparison-table th {
        padding: 0.5rem;
    }
}
