/* NENA 2.1 Emergency Data Collector Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    min-height: 100vh;
}

/* 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;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

header h1 {
    color: #1a365d;
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 800;
    letter-spacing: -0.025em;
}

header p {
    color: #4a5568;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 500;
}

.form-container {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    margin-bottom: 30px;
}

.form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #ecf0f1;
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h2 {
    color: #1a365d;
    font-size: 1.5rem;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 3px solid #e53e3e;
    display: inline-block;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #1a365d;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
    transform: translateY(-1px);
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #7f8c8d;
    font-style: italic;
}

.validation-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.validation-container h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.validation-status {
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-weight: 600;
}

.validation-status.valid {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.validation-status.invalid {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.validation-details {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
}

.validation-details ul {
    margin: 0;
    padding-left: 20px;
}

.validation-details li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.validation-details .error {
    color: #dc3545;
}

.validation-details .warning {
    color: #ffc107;
}

.validation-details .success {
    color: #28a745;
}

.form-group input:invalid {
    border-color: #e74c3c;
}

.form-group input:valid {
    border-color: #27ae60;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 200px;
}

.btn-primary {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    color: white;
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.3);
    border: 1px solid #e53e3e;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 62, 62, 0.4);
    background: linear-gradient(135deg, #c53030, #9c2626);
}

.btn-secondary {
    background: linear-gradient(135deg, #1a365d, #2d3748);
    color: white;
    box-shadow: 0 4px 15px rgba(26, 54, 93, 0.3);
    border: 1px solid #1a365d;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 54, 93, 0.4);
    background: linear-gradient(135deg, #2d3748, #1a202c);
}

.preview-container {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    margin-top: 30px;
}

.preview-container h2 {
    color: #1a365d;
    font-size: 1.8rem;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.preview-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

.preview-info p {
    margin: 0;
    font-weight: 600;
    color: #2c3e50;
}

.preview-output {
    margin-bottom: 25px;
}

.preview-line {
    margin-bottom: 15px;
}

.preview-line label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.preview-line-content {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    background: #f8f9fa;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    padding: 12px;
    word-break: break-all;
    white-space: pre-wrap;
    min-height: 20px;
    color: #2c3e50;
}

.preview-line-content.valid {
    border-color: #27ae60;
    background-color: #d5f4e6;
}

.preview-line-content.invalid {
    border-color: #e74c3c;
    background-color: #fadbd8;
}

.result-container {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    margin-top: 30px;
}

.result-container h2 {
    color: #1a365d;
    font-size: 1.8rem;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.document-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

.document-info p {
    margin: 0;
    font-weight: 600;
    color: #2c3e50;
}

.document-output {
    margin-bottom: 25px;
}

.document-output textarea {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    background: #f8f9fa;
    resize: vertical;
}

.document-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .form-container,
    .result-container {
        padding: 20px;
    }
    
    .form-actions,
    .document-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        max-width: 300px;
    }
    
    .document-info {
        flex-direction: column;
        text-align: center;
    }
    
    .preview-info {
        flex-direction: column;
        text-align: center;
    }
    
    .preview-line-content {
        font-size: 0.75rem;
        padding: 8px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .form-section h2 {
        font-size: 1.3rem;
    }
}

/* Animation for form sections */
.form-section {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Success/Error states */
.success {
    border-color: #27ae60 !important;
    background-color: #d5f4e6 !important;
}

.error {
    border-color: #e74c3c !important;
    background-color: #fadbd8 !important;
}

/* Character count indicator */
.char-count {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 5px;
}

.char-count.warning {
    color: #f39c12;
}

.char-count.danger {
    color: #e74c3c;
}

/* Home Page Styles */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left {
    flex: 1;
    min-width: 300px;
}

.header-right {
    flex-shrink: 0;
}

.user-menu {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.user-menu a {
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 140px;
    display: inline-block;
}

.btn-admin {
    background: linear-gradient(135deg, #4a5568, #2d3748);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 85, 104, 0.3);
    border: 1px solid #4a5568;
}

.btn-admin:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 85, 104, 0.4);
    background: linear-gradient(135deg, #2d3748, #1a202c);
}

.welcome-container {
    background: #ffffff;
    padding: 50px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    text-align: center;
}

.welcome-container h2 {
    color: #1a365d;
    font-size: 2.2rem;
    margin-bottom: 40px;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.tool-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.tool-card {
    background: #ffffff;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #e53e3e, #c53030);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    border-color: #e53e3e;
}

.tool-card h3 {
    color: #1a365d;
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: -0.025em;
}

.tool-card p {
    color: #4a5568;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    min-height: 60px;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.tool-card .btn-primary,
.tool-card .btn-secondary,
.tool-card .btn-admin {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
    display: block;
}

/* Enhanced Responsive Design for Home Page */
@media (max-width: 1024px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-left {
        min-width: auto;
    }
    
    .user-menu {
        justify-content: center;
        width: 100%;
    }
    
    .tool-cards {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 25px;
    }
    
    .welcome-container {
        padding: 40px 30px;
    }
    
    .welcome-container h2 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .welcome-container {
        padding: 30px 20px;
    }
    
    .welcome-container h2 {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }
    
    .tool-cards {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 500px;
    }
    
    .tool-card {
        padding: 30px 20px;
    }
    
    .tool-card h3 {
        font-size: 1.3rem;
    }
    
    .tool-card p {
        font-size: 0.95rem;
        min-height: auto;
    }
    
    .user-menu {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .user-menu a {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .welcome-container {
        padding: 20px 15px;
    }
    
    .welcome-container h2 {
        font-size: 1.6rem;
        margin-bottom: 25px;
    }
    
    .tool-card {
        padding: 25px 15px;
    }
    
    .tool-card h3 {
        font-size: 1.2rem;
        flex-direction: column;
        gap: 5px;
    }
    
    .tool-card p {
        font-size: 0.9rem;
        margin-bottom: 25px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .header p {
        font-size: 1rem;
    }
}

/* ALLO Business Professional Enhancements */
.header-content {
    position: relative;
}

.header-content::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #e53e3e, #c53030);
    border-radius: 2px;
}

.tool-card {
    position: relative;
    overflow: hidden;
}

.tool-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-top: 20px solid #f7fafc;
    transition: all 0.3s ease;
}

.tool-card:hover::after {
    border-top-color: #e53e3e;
}

/* Professional spacing improvements */
.container {
    padding: 30px 20px;
}

header {
    margin-bottom: 60px;
}

.welcome-container {
    margin-bottom: 40px;
}

/* Enhanced button styling */
.btn-primary,
.btn-secondary,
.btn-admin {
    position: relative;
    overflow: hidden;
    font-weight: 700;
    letter-spacing: 0.025em;
}

.btn-primary::before,
.btn-secondary::before,
.btn-admin::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before,
.btn-secondary:hover::before,
.btn-admin:hover::before {
    left: 100%;
}

/* Cross-browser compatibility improvements */
@supports not (backdrop-filter: blur(10px)) {
    .welcome-container,
    .tool-card {
        background: #ffffff;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tool-card {
        border: 2px solid #1a365d;
    }
    
    .tool-card:hover {
        border-color: #e53e3e;
        background: #f7fafc;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .tool-card,
    .tool-card::before,
    .user-menu a,
    .btn-primary,
    .btn-secondary,
    .btn-admin {
        transition: none;
    }
    
    .tool-card:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .user-menu {
        display: none;
    }
    
    .tool-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tool-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}