/* Langton's Ant Styles */

.ant-container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 60px);
    padding: 0;
    max-width: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.ant-controls-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.ant-stats {
    display: flex;
    gap: 15px;
    font-weight: bold;
    color: #333;
}

.ant-stats.compact {
    font-size: 12px !important;
}

.ant-stats label {
    padding: 5px 10px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-colored {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: #00ff88;
    border: 1px solid #333;
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
}

.legend-ant {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: #ff0000;
    border: 1px solid #333;
    border-radius: 2px;
}

.legend-state {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 1px solid #333;
    border-radius: 2px;
}

.ant-action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ant-canvas-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #0a0a0a;
    padding: 4px;
    overflow: hidden;
    width: 100%;
    min-height: 400px;
    max-height: calc(100vh - 280px);
    height: 100%;
}

.ant-canvas {
    border: 2px solid #ff6b6b;
    background: #1a1a2e;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
    cursor: crosshair;
    touch-action: none;
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
}

.ant-controls-bottom {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    justify-content: space-around;
    flex-shrink: 0;
}

.ant-control-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
}

.ant-control-column h4 {
    margin: 0 0 5px 0;
    color: #16213e;
    font-size: 14px;
    font-weight: bold;
    border-bottom: 2px solid #ff6b6b;
    padding-bottom: 3px;
}

.ant-control-column label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #333;
}

.ant-control-column label span:first-child {
    min-width: 90px;
    font-weight: 500;
}

.ant-control-column label input[type="number"] {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.ant-control-column label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.ant-control-column label .val {
    font-weight: bold;
    color: #16213e;
    min-width: 30px;
}

.ant-info {
    padding: 10px;
    background: rgba(255, 255, 255, 0.95);
    text-align: center;
    font-size: 13px;
    color: #555;
    flex-shrink: 0;
}

.ant-info p {
    margin: 5px 0;
}

.ant-info strong {
    color: #16213e;
}

.ant-info a {
    color: #ff6b6b;
    text-decoration: none;
}

.ant-info a:hover {
    text-decoration: underline;
}

.ant-btn {
    padding: 4px 10px !important;
    font-size: 12px !important;
    border: none;
    border-radius: 4px;
    background: #16213e;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    margin: 0 2px !important;
}

.ant-btn:hover {
    background: #1a3a5c;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.ant-btn:active {
    transform: translateY(0);
}

.ant-btn.active {
    background: #ff6b6b;
    color: white;
}

.ant-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.ant-btn-small {
    padding: 2px 6px !important;
    font-size: 11px !important;
    border: none;
    border-radius: 3px;
    background: #16213e;
    color: white;
    cursor: pointer;
}

.ant-btn-small:hover {
    background: #1a3a5c;
}

/* Rule selector dropdown */
.ant-select {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    min-width: 180px;
}

.ant-select:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 5px rgba(255, 107, 107, 0.3);
}

/* Custom rule input */
.ant-input {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.ant-input:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 5px rgba(255, 107, 107, 0.3);
}

/* Legend below canvas */
.ant-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #dee2e6;
    font-size: 13px;
    font-weight: 500;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Responsive design */
@media (max-width: 768px) {
    .ant-container {
        padding: 0;
    }

    .ant-controls-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .ant-stats {
        justify-content: flex-start;
        width: 100%;
        flex-wrap: wrap;
    }

    .ant-action-buttons {
        justify-content: flex-start;
        width: 100%;
    }

    .ant-controls-bottom {
        flex-direction: column;
    }

    .ant-control-column {
        min-width: auto;
    }

    .ant-canvas-section {
        min-height: 300px;
        max-height: calc(100vh - 380px);
    }

    .ant-legend {
        gap: 10px;
    }

    .ant-select {
        min-width: 150px;
    }
}
