/* =============================================================================
 * Name:         index-form.css
 * Version:      2.3.1
 * Date:         September 30, 2025
 * 
 * Author:       Jason O. Watson (jason@jasonowatson.com)
 * Copyright:    Copyright (c) 2008-2025, Jason O. Watson. All rights reserved.
 *               Unauthorized use or distribution is prohibited.
 * 
 * Description:
 * Streamlined stylesheet for the code replacement form interface with 
 * authentication styles and form access control styling. Consolidated from 
 * 25+ versions with duplicates removed and unused styles eliminated.
 * Location: /var/www/codereplacements.com/html/css/index-form.css
 * 
 * CONSOLIDATED CHANGELOG SUMMARY (Versions 1.0 - 2.2.5):
 * - Authentication system integration (form disabling, overlay popups)
 * - Responsive design implementation
 * - Accessibility enhancements (ARIA support, high contrast)
 * - Visual refinements (gradients, shadows, hover effects)
 * - Layout optimizations (reduced whitespace, inline labels)
 * - Help text standardization (italic for field help, normal for notices)
 * - Header streamlining (reduced padding, bold centered text)
 * - Form field improvements (full-width inputs, proper flex layout)
 * 
 * CHANGES in v2.3.1:
 * - EXTRACTED inline styles from index.cgi v5.3.2 to external CSS
 * - ADDED .notice-box-guest for guest authentication notices
 * - ADDED .auth-overlay-button for overlay close button styling
 * - ADDED .error-container for error page styling
 * - NO CHANGES to any existing v2.3.0 styles
 * 
 * CHANGES in v2.3.0:
 * - CONSOLIDATED 25+ versions of changelog into summary
 * - REMOVED duplicate CSS declarations
 * - ELIMINATED unused styles (options-grid, team-selection-container)
 * - ORGANIZED styles by component hierarchy
 * - OPTIMIZED selector specificity
 * - MAINTAINED all functional styles from v2.2.5
 * ============================================================================= */

/* =============================================================================
   BASE STYLES
   ============================================================================= */

.cr-form * {
    box-sizing: border-box;
}

/* =============================================================================
   MAIN CONTAINERS
   ============================================================================= */

.cr-form {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px;
}

.sport-form {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
    line-height: 1.6;
    color: #333;
}

.form-container {
    position: relative;
    transition: all 0.3s ease;
}

/* =============================================================================
   PAGE HEADER & NOTICES
   ============================================================================= */

.page-header {
    text-align: center;
    margin: 0;
    padding: 0;
}

.page-header h1 {
    color: #37c0fb;
    font-size: 2.2em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-weight: 600;
    margin: 0 0 2px 0;
}

hr {
    margin: 2px 0 5px 0;
    border: 0;
    border-top: 1px solid #dee2e6;
}

/* Update Notice & Submission Note - Shared Styles */
.update-notice,
.submission-note,
.submission-help-left {
    font-size: 0.95em;
    color: #6c757d;
    font-style: normal;
    line-height: 1.4;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #37c0fb;
}

.update-notice {
    margin-bottom: 5px;
    text-align: left;
}

.update-notice p {
    margin: 0;
    color: #6c757d;
    font-size: 1em;
}

.update-notice strong {
    color: #495057;
    font-weight: 600;
}

.submission-note {
    margin-top: 10px;
}

.submission-help-left {
    clear: both;
    padding-top: 10px;
    margin-top: 10px;
}

/* =============================================================================
   AUTHENTICATION STYLES
   ============================================================================= */

/* Authentication Status Badge */
.auth-status {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    background: white !important;
    padding: 8px 12px !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 5px !important;
    font-size: 0.9em !important;
    color: #666 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
    z-index: 1000 !important;
}

/* Notice Box for Login Prompts - Generic */
.notice-box {
    margin: 5px 0;
    padding: 15px;
    background: #f0f8ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
    color: #004080;
    font-size: 0.95em;
}

.notice-box a {
    color: #0066cc;
    text-decoration: underline;
}

/* Notice Box - Guest Specific (NEW in v2.3.1 - Extracted from index.cgi v5.3.2) */
.notice-box-guest {
    background-color: #e6f7fe;
    border: 1px solid #37c0fb;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 14px;
}

.notice-box-guest a {
    color: #37c0fb;
    text-decoration: none;
    font-weight: bold;
}

.notice-box-guest a:hover {
    text-decoration: underline;
}

/* Form Disabled State */
.form-disabled input:disabled,
.form-disabled select:disabled,
.form-disabled textarea:disabled {
    cursor: not-allowed !important;
    background-color: #f8f9fa;
    color: #6c757d;
}

.form-disabled button:disabled,
.form-disabled input[type="submit"]:disabled,
.form-disabled input[type="reset"]:disabled,
.form-disabled .btn-primary:disabled,
.form-disabled .btn-secondary:disabled {
    background: linear-gradient(135deg, #ced4da 0%, #adb5bd 100%) !important;
    cursor: not-allowed !important;
    opacity: 0.6;
    box-shadow: none;
}

.form-disabled .btn-primary:disabled:hover,
.form-disabled .btn-secondary:disabled:hover {
    transform: none;
    box-shadow: none;
    background: linear-gradient(135deg, #ced4da 0%, #adb5bd 100%) !important;
}

.form-disabled input[type="radio"]:disabled,
.form-disabled input[type="checkbox"]:disabled {
    cursor: not-allowed !important;
    opacity: 0.7;
}

/* Keep visual effects even when disabled */
.form-disabled .team-section:hover,
.form-disabled .option-group:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    border-color: #37c0fb;
}

/* Authentication Overlay Popup */
.auth-required-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    text-align: center;
    max-width: 400px;
}

.auth-required-overlay h3 {
    color: #37c0fb;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.auth-required-overlay p {
    color: #495057;
    margin-bottom: 15px;
    line-height: 1.5;
}

.auth-required-overlay .buttons {
    margin-top: 15px;
}

.auth-required-overlay .button {
    display: inline-block;
    padding: 8px 20px;
    margin: 0 5px;
    background-color: #37c0fb;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.auth-required-overlay .button:hover {
    background-color: #2ba0d8;
}

/* Close button for overlay (NEW in v2.3.1 - Extracted from index.cgi v5.3.2) */
.auth-overlay-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 28px;
    text-align: center;
    font-family: Arial, sans-serif;
    font-weight: bold;
}

.auth-overlay-button:hover {
    color: #666;
}

/* =============================================================================
   ERROR CONTAINERS (NEW in v2.3.1 - Extracted from index.cgi v5.3.2)
   ============================================================================= */

.error-container {
    max-width: 800px;
    margin: 50px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.error-container h2 {
    color: #dc3545;
    margin-bottom: 15px;
}

.error-container p {
    color: #6c757d;
    margin-bottom: 10px;
    line-height: 1.6;
}

.error-container code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #e83e8c;
}

/* =============================================================================
   PROGRAM SELECTION (Currently Not Styled - Uses Inline)
   ============================================================================= */

/* Note: The program selection is generated with inline styles in FormComponents.pm
   These styles are here for future use if we move away from inline styles */

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

/* =============================================================================
   TEAM SECTIONS
   ============================================================================= */

.teams-container {
    margin: 0;
}

.team-section {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin: 5px;
    transition: box-shadow 0.3s ease;
    overflow: hidden;
}

.team-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.team-header {
    background: linear-gradient(135deg, #37c0fb 0%, #2aa8e0 100%);
    color: white;
    padding: 8px 20px;
    font-size: 1.25em;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.team-controls {
    padding: 20px;
    background: #fafafa;
}

.team-controls .form-group {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    width: 100%;
}

.team-controls label {
    display: inline-block;
    min-width: 130px;
    width: 130px;
    margin-bottom: 0;
    margin-right: 10px;
    color: #495057;
    font-weight: 700;
    font-size: 0.95em;
    flex-shrink: 0;
}

.team-controls input[type="text"],
.team-controls select {
    flex-grow: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
}

.team-controls input[type="text"]:focus,
.team-controls select:focus {
    border-color: #37c0fb;
    box-shadow: 0 0 0 3px rgba(55, 192, 251, 0.1);
    outline: none;
}

.team-controls input[type="text"]:hover,
.team-controls select:hover {
    border-color: #adb5bd;
}

/* =============================================================================
   OPTIONS SECTION
   ============================================================================= */

.options-container {
    margin-top: 2px;
    background: white;
}

.options-header {
    background: linear-gradient(135deg, #37c0fb 0%, #2aa8e0 100%);
    color: white;
    padding: 8px 20px;
    font-size: 1.25em;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    border-radius: 8px 8px 0 0;
    margin: 0;
}

.options-content {
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 10px;
    background: #fcfcfc;
}

.option-group {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.option-group:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    border-color: #37c0fb;
}

.option-group h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.1em;
    font-weight: 600;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.option-group .sub-label {
    margin: -5px 0 10px 0;
    color: #6c757d;
    font-size: 0.9em;
    font-style: italic;
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 0.95em;
    transition: color 0.2s ease;
}

.radio-option:hover,
.checkbox-option:hover {
    color: #37c0fb;
}

.radio-option input,
.checkbox-option input {
    margin-right: 10px;
    transform: scale(1.1);
}

.radio-option input[type="radio"],
.checkbox-option input[type="checkbox"] {
    accent-color: #37c0fb;
}

/* =============================================================================
   HELP TEXT - Unified Styles
   ============================================================================= */

/* General help text (italic style for field descriptions) */
.help-text,
.program-selection .help-text,
.team-controls .help-text,
.team-controls small.help-text,
.option-group .help-text {
    font-size: 0.95em;
    color: #6c757d;
    font-style: italic;
    line-height: 1.4;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #37c0fb;
}

/* Team controls specific help text positioning */
.team-controls .help-text,
.team-controls small.help-text {
    display: block !important;
    width: calc(100% - 140px);
    margin-top: 5px;
    margin-left: 140px;
    margin-bottom: 15px;
    margin-right: 0;
    clear: both;
    position: relative;
}

.program-selection .help-text,
.option-group .help-text {
    margin-top: 10px;
}

/* =============================================================================
   FORM SUBMISSION
   ============================================================================= */

.submission-section {
    margin-top: 30px;
    padding-top: 25px;
}

.form-actions-left {
    float: left;
    margin-bottom: 10px;
}

.btn-primary,
.btn-secondary {
    border: none;
    padding: 12px 30px;
    font-size: 1.05em;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #37c0fb 0%, #2aa8e0 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(55, 192, 251, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2aa8e0 0%, #1e90c8 100%);
    box-shadow: 0 6px 12px rgba(55, 192, 251, 0.4);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(55, 192, 251, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

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

@media screen and (max-width: 768px) {
    .cr-form {
	margin: 10px;
	padding: 15px;
    }

    .auth-status {
	position: relative !important;
	top: auto !important;
	right: auto !important;
	margin-bottom: 10px;
	display: block;
	text-align: center;
    }

    .page-header h1 {
	font-size: 1.8em;
    }

    .team-section {
	margin: 5px 0;
    }

    /* Stack form controls on mobile */
    .team-controls .form-group {
	flex-direction: column;
	align-items: flex-start;
    }

    .team-controls label {
	width: 100%;
	margin-bottom: 5px;
    }

    .team-controls input[type="text"],
    .team-controls select {
	width: 100%;
    }

    .team-controls .help-text,
    .team-controls small.help-text {
	margin-left: 0;
	width: 100%;
    }

    .btn-primary,
    .btn-secondary {
	width: 100%;
	max-width: 300px;
    }

    .auth-required-overlay {
	width: 90%;
	max-width: 350px;
	padding: 15px 20px;
    }

    .error-container {
	margin: 20px auto;
	padding: 15px;
    }
}

@media screen and (max-width: 480px) {
    .cr-form {
	margin: 5px;
	padding: 10px;
    }

    .page-header h1 {
	font-size: 1.5em;
    }

    .team-header {
	font-size: 1.1em;
	padding: 12px 15px;
    }

    .team-controls,
    .option-group {
	padding: 15px;
    }

    .auth-required-overlay h3 {
	font-size: 1.1em;
    }

    .auth-required-overlay p {
	font-size: 0.9em;
    }

    .error-container {
	margin: 10px;
	padding: 15px;
    }
}

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

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

.form-control:focus,
.btn-primary:focus,
.btn-secondary:focus {
    outline: 2px solid #37c0fb;
    outline-offset: 2px;
}

@media (prefers-contrast: high) {
    .team-section,
    .form-control {
	border-width: 2px;
    }

    .btn-primary,
    .btn-secondary {
	border: 2px solid currentColor;
    }
}