/* Modern Form Layouts - Replaces Table-Based Forms
 * Uses CSS Grid and Flexbox for responsive, accessible forms
 */

/* ========================================
 * Form Container
 * ======================================== */
.form-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* ========================================
 * Form Sections
 * ======================================== */
.form-section {
    margin-bottom: 30px;
}

.form-section h2 {
    color: var(--stf-text-light);
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--stf-border);
}

/* ========================================
 * Form Fields - Modern Grid Layout
 * ======================================== */
.form-field {
    display: grid;
    grid-template-columns: 175px 5px 1fr;
    gap: 0;
    margin-bottom: 15px;
    align-items: center;
}

.form-field-label {
    text-align: right;
    padding-right: 10px;
    color: var(--stf-text-light);
    font-weight: bold;
    font-size: 12px;
}

.form-field-separator {
    text-align: center;
    color: var(--stf-text-light);
    font-weight: bold;
    padding: 0 5px;
}

.form-field-input {
    padding-left: 10px;
}

.form-field-input input[type="text"],
.form-field-input input[type="email"],
.form-field-input input[type="password"],
.form-field-input select,
.form-field-input textarea {
    width: 100%;
    max-width: 400px;
    padding: 8px;
    background-color: #111111;
    border: 1px solid var(--stf-border);
    color: var(--stf-text-light);
    font-size: 12px;
    box-sizing: border-box;
}

.form-field-input input:focus,
.form-field-input select:focus,
.form-field-input textarea:focus {
    outline: 2px solid var(--stf-primary);
    outline-offset: 2px;
    border-color: var(--stf-primary);
}

.form-field-input textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

/* ========================================
 * Form Buttons
 * ======================================== */
.form-actions {
    margin-top: 30px;
    text-align: center;
}

.form-actions .button,
.form-actions input[type="submit"],
.form-actions button {
    background-color: var(--stf-primary);
    color: var(--stf-bg-dark);
    border: none;
    padding: 12px 30px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
}

.form-actions .button:hover,
.form-actions input[type="submit"]:hover,
.form-actions button:hover {
    background-color: #ffb733;
}

.form-actions .button:active,
.form-actions input[type="submit"]:active,
.form-actions button:active {
    background-color: #e69405;
}

/* ========================================
 * Responsive Design
 * ======================================== */

/* Tablets and smaller */
@media (max-width: 768px) {
    .form-field {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .form-field-label {
        text-align: left;
        padding-right: 0;
        padding-bottom: 5px;
    }
    
    .form-field-separator {
        display: none;
    }
    
    .form-field-input {
        padding-left: 0;
    }
    
    .form-field-input input[type="text"],
    .form-field-input input[type="email"],
    .form-field-input input[type="password"],
    .form-field-input select,
    .form-field-input textarea {
        max-width: 100%;
    }
}

/* Mobile phones */
@media (max-width: 600px) {
    .form-container {
        padding: 15px;
    }
    
    .form-section h2 {
        font-size: 16px;
    }
    
    .form-field {
        margin-bottom: 20px;
    }
}

/* ========================================
 * Timeline/Data Display (replaces table-based timelines)
 * ======================================== */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.timeline-item {
    display: grid;
    grid-template-columns: 80px 20px 1fr;
    gap: 10px;
    align-items: start;
}

.timeline-year {
    text-align: center;
    font-weight: bold;
    color: var(--stf-primary);
    font-size: 14px;
}

.timeline-separator {
    text-align: center;
    color: var(--stf-text-light);
    font-weight: bold;
}

.timeline-content {
    color: var(--stf-text-light);
    font-size: 12px;
    line-height: 1.6;
}

/* Data Table (for region page, etc.) */
.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 1px;
    background-color: var(--stf-border);
    margin: 20px 0;
    border: 1px solid var(--stf-border);
}

.data-grid-header {
    background-color: var(--stf-bg-darker);
    padding: 12px;
    font-weight: bold;
    color: var(--stf-text-light);
    text-align: center;
    font-size: 14px;
}

.data-grid-cell {
    background-color: var(--stf-bg-content);
    padding: 10px;
    color: var(--stf-text-light);
    font-size: 12px;
    vertical-align: top;
}

.data-grid-cell:first-child {
    text-align: center;
    font-weight: bold;
}

/* Responsive data grid */
@media (max-width: 768px) {
    .data-grid {
        grid-template-columns: 1fr;
    }
    
    .data-grid-header {
        display: none;
    }
    
    .data-grid-cell::before {
        content: attr(data-label) ": ";
        font-weight: bold;
        display: inline-block;
        min-width: 120px;
    }
    
    .timeline-item {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .timeline-year {
        text-align: left;
    }
    
    .timeline-separator {
        display: none;
    }
}

/* ========================================
 * Legacy Table Support (for backward compatibility)
 * ======================================== */
table.pretty-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

table.pretty-table td {
    padding: 8px;
    vertical-align: middle;
}

/* Convert table-based forms to modern layout when ready */
.pretty-table .form-field {
    display: contents; /* Allows grid to work within table cells */
}

