/**
 * TSOH Frontend Styles
 *
 * @package TSOH
 * @since 1.0.0
 */

.tsoh-shortcode {
    padding: 20px;
    margin: 20px 0;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.tsoh-content h3 {
    margin-top: 0;
    color: #333;
}

.tsoh-shortcode-content {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

/* Worksheet Form Styles */
.tsoh-worksheet-form {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tsoh-worksheet-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #0073aa;
}

.tsoh-worksheet-header h2 {
    margin: 0 0 10px 0;
    color: #23282d;
    font-size: 28px;
    font-weight: 600;
}

.tsoh-worksheet-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.tsoh-worksheet-meta span {
    display: inline-block;
    padding: 6px 12px;
    background: #f0f0f1;
    border-radius: 4px;
    font-size: 13px;
    color: #50575e;
}

.tsoh-worksheet-type {
    background: #d7f0ff !important;
    color: #0073aa !important;
    font-weight: 600;
}

.tsoh-worksheet-var {
    font-family: monospace;
    background: #fff3cd !important;
    color: #856404 !important;
}

.tsoh-worksheet-revision {
    background: #d4edda !important;
    color: #155724 !important;
}

/* Section Styles */
.tsoh-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.tsoh-section-title {
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
    color: #23282d;
    font-size: 20px;
    font-weight: 600;
}

/* Form Fields Styles */
.tsoh-form-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.tsoh-form-field {
    display: flex;
    flex-direction: column;
}

.tsoh-form-field label {
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #23282d;
}

.tsoh-form-field label .required {
    color: #d63638;
    margin-left: 2px;
}

.tsoh-form-field .tsoh-input {
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    background: #fff;
    transition: border-color 0.2s;
}

.tsoh-form-field .tsoh-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.tsoh-form-field .tsoh-input[readonly] {
    background: #f0f0f1;
    cursor: not-allowed;
}

/* Table Fields Styles */
.tsoh-table-fields {
    overflow-x: auto;
}

.tsoh-table-controls {
    margin-bottom: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tsoh-table-controls label {
    font-weight: 600;
    font-size: 14px;
    color: #23282d;
}

.tsoh-num-rows-input {
    width: 100px;
    padding: 6px 10px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
}

.tsoh-num-rows-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.tsoh-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.tsoh-table thead {
    background: #f0f0f1;
}

.tsoh-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #23282d;
    border-bottom: 2px solid #ddd;
    border-right: 1px solid #ddd;
}

.tsoh-table th:last-child {
    border-right: none;
}

.tsoh-table th.row-number {
    width: 50px;
    text-align: center;
}

.tsoh-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
}

.tsoh-table tbody tr:last-child {
    border-bottom: none;
}

.tsoh-table tbody tr:hover {
    background: #f9f9f9;
}

.tsoh-table td {
    padding: 8px;
    border-right: 1px solid #e0e0e0;
}

.tsoh-table td:last-child {
    border-right: none;
}

.tsoh-table td.row-number {
    text-align: center;
    font-weight: 600;
    color: #666;
    background: #fafafa;
}

.tsoh-table-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #8c8f94;
    border-radius: 3px;
    font-size: 13px;
    line-height: 1.4;
    background: #fff;
}

.tsoh-table-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.tsoh-table-input[readonly],
.tsoh-table-input[disabled] {
    background: #f0f0f1;
    cursor: not-allowed;
}

/* Template (hidden) */
.tsoh-table-row-template {
    display: none;
}

/* Error and Notice Styles */
.tsoh-error,
.tsoh-notice {
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.tsoh-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.tsoh-notice {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tsoh-form-fields {
        grid-template-columns: 1fr;
    }
    
    .tsoh-worksheet-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .tsoh-table-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tsoh-num-rows-input {
        width: 100%;
    }
}
