/* Unique ANOVA Workspace Design */
.anova-workspace {
    margin-top: 2.5rem;
    margin-bottom: 3rem;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: stretch;
}

/* Left Workspace - Input Section */
.workspace-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 600px;
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.control-bar {
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.2);
}

.control-group {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.control-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.875rem;
    font-weight: 500;
}

.label-main {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.label-symbol {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-style: italic;
    font-weight: 600;
}

.select-wrapper {
    position: relative;
    margin-top: 0.5rem;
}

.control-select {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #0f766e;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.control-select:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.control-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.select-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #0f766e;
}

/* Data Entry Zone */
.data-entry-zone {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    border: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.zone-header {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
}

.zone-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.25rem 0;
}

.zone-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.groups-rack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    overflow-y: auto;
}

.group-card {
    background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 100%);
    border: 2px solid #ccfbf1;
    border-radius: 10px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.group-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #14b8a6 0%, #0f766e 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.group-card:focus-within {
    border-color: #14b8a6;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.15);
    transform: translateX(2px);
}

.group-card:focus-within::before {
    opacity: 1;
}

.group-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.group-indicator {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
    color: white;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(20, 184, 166, 0.3);
}

.group-label-text {
    font-weight: 600;
    color: #111827;
    font-size: 0.95rem;
}

.group-input-field {
    width: 100%;
    min-height: 90px;
    padding: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    resize: vertical;
    background: white;
    color: #111827;
    transition: all 0.2s ease;
}

.group-input-field:focus {
    outline: none;
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.group-input-field::placeholder {
    color: #9ca3af;
}

.group-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.group-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.group-meta-value {
    font-weight: 600;
    color: #0f766e;
}

/* Action Zone */
.action-zone {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.compute-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
    min-height: 52px;
}

.compute-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.4);
}

.compute-button:active {
    transform: translateY(0);
}

.compute-icon {
    display: flex;
    align-items: center;
}

.reset-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background: white;
    color: #6b7280;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 52px;
}

.reset-button:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
}

/* Right Workspace - Results Section */
.workspace-right {
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

.results-display {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.results-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    min-height: 600px;
    text-align: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.placeholder-icon {
    color: #d1d5db;
    margin-bottom: 1rem;
}

.placeholder-text {
    color: #9ca3af;
    font-size: 0.95rem;
    margin: 0;
}

.results-content {
    animation: fadeInUp 0.4s ease;
    display: flex;
    flex-direction: column;
    min-height: 600px;
    flex: 1;
}

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

.results-summary {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.summary-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.summary-status {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-status.success {
    background: #10b981;
    color: white;
}

.summary-status.info {
    background: #3b82f6;
    color: white;
}

.summary-status.warning {
    background: #f59e0b;
    color: white;
}

.key-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.key-metric {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.metric-name {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.metric-symbol {
    font-size: 0.875rem;
    color: #0f766e;
    font-weight: 700;
    font-style: italic;
}

.metric-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.results-details {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex: 1;
    overflow-y: auto;
}

.detail-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.section-header {
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f3f4f6;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 500px;
}

.results-table thead {
    background: #f9fafb;
}

.results-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 2px solid #e5e7eb;
}

.results-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    color: #111827;
    font-size: 0.9rem;
}

.results-table tbody tr:last-child {
    background: #f9fafb;
    font-weight: 600;
}

.results-table tbody tr:last-child td {
    border-top: 2px solid #d1d5db;
    border-bottom: none;
}

.groups-detail {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.group-detail-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    border-left: 3px solid #14b8a6;
}

.group-detail-header {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.group-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.group-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.group-detail-label {
    font-size: 0.7rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.group-detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.formulas-display {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.formula-block {
    background: #f9fafb;
    border-left: 3px solid #0f766e;
    border-radius: 6px;
    padding: 1rem;
}

.formula-name {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.formula-expression {
    font-size: 1rem;
    color: #111827;
    font-weight: 600;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .workspace-left,
    .workspace-right {
        min-height: 500px;
    }

    .results-display,
    .results-placeholder,
    .results-content {
        min-height: 500px;
    }

    .key-metrics {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .control-group {
        flex-direction: column;
        align-items: stretch;
    }

    .action-zone {
        flex-direction: column;
    }

    .compute-button,
    .reset-button {
        width: 100%;
    }

    .groups-detail {
        grid-template-columns: 1fr;
    }

    .group-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .data-entry-zone {
        padding: 1rem;
    }

    .results-details {
        padding: 1rem;
    }

    .results-summary {
        padding: 1rem;
    }

    .group-card {
        padding: 1rem;
    }
}
