/* Metabollica - Main Styles */

/* Base Styles */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: #2a4a5c;
}

/* React Flow Customizations */
.react-flow__minimap {
    background-color: #f9fafb;
}

.react-flow__controls {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Control Panel Styles */
.control-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 16px rgba(0, 0, 0, 0.08);
    z-index: 10;
    min-width: 220px;
    max-width: 240px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.control-header {
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(107, 114, 128, 0.1);
    padding-bottom: 12px;
}

.control-title {
    margin: 0 0 4px 0;
    color: #1f2937;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.control-subtitle {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
    font-weight: 400;
    line-height: 1.3;
}

.control-section {
    margin-bottom: 16px;
}

.control-section:last-child {
    margin-bottom: 0;
}

.features-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(107, 114, 128, 0.1);
}

.features-title {
    margin: 0 0 10px 0;
    font-weight: 600;
    color: #374151;
    font-size: 13px;
    letter-spacing: 0.025em;
}

.features-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.features-list li {
    padding: 4px 0;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
    position: relative;
    padding-left: 16px;
}

.features-list li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: #4a6741;
    font-weight: bold;
}

/* Button Styles */
.btn {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.025em;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(-1px);
}

.btn span {
    margin-right: 6px;
    font-size: 13px;
}

.btn-primary { 
    background: #3d5a73;
    color: white;
    box-shadow: 0 4px 15px rgba(61, 90, 115, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(61, 90, 115, 0.4);
}

.btn-secondary { 
    background: #8b4513;
    color: white;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.4);
}

.btn-tertiary { 
    background: #2f4f4f;
    color: white;
    box-shadow: 0 4px 15px rgba(47, 79, 79, 0.3);
}

.btn-tertiary:hover {
    box-shadow: 0 8px 25px rgba(47, 79, 79, 0.4);
}

/* Metabolite Node Styles */
.metabolite-node {
    background: white;
    border: 2px solid #4a6741;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    max-width: 200px;
    text-align: center;
    transition: all 0.2s ease;
}

.metabolite-node:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.metabolite-node[style*="cursor: pointer"]:hover {
    transform: scale(1.08);
    box-shadow: 0 15px 40px rgba(74, 103, 65, 0.3);
}

.substrate-node {
    background: #f5f5dc;
    border: 2px solid #8b4513;
}

.metabolite-node .molecule-image {
    width: 160px;
    height: 120px;
    object-fit: cover;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    padding: 2px;
    image-rendering: crisp-edges;
}

.metabolite-node .name {
    font-weight: 600;
    color: #1f2937;
    font-size: 13px;
    margin: 4px 0;
    line-height: 1.2;
}

.metabolite-node .description {
    font-size: 10px;
    color: #6b7280;
    font-style: italic;
    line-height: 1.1;
    margin-top: 3px;
}

/* Title and Info Panel Styles */
.cycle-title {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 20px 30px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 16px rgba(0, 0, 0, 0.08);
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.outputs-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(15px);
    padding: 20px 24px;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 20px rgba(74, 103, 65, 0.1);
    z-index: 5;
    min-width: 200px;
    max-width: 240px;
    border: 2px solid rgba(74, 103, 65, 0.2);
    text-align: center;
}

/* Edge Styles */
.enzyme-edge {
    stroke: #4a6741;
    stroke-width: 6;
    cursor: pointer;
}

.enzyme-edge:hover {
    stroke-width: 8;
    stroke: #5a7751;
}

/* Energy Product Edge Styles */
.energy-products .energy-product-edge,
.energy-products .energy-cofactor-edge {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.energy-products .energy-product-label circle,
.energy-products .energy-product-label rect,
.energy-products .energy-cofactor-label circle,
.energy-products .energy-cofactor-label rect {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.energy-products .energy-product-label text,
.energy-products .energy-cofactor-label text {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Distinguish cofactor edges (inputs) from product edges (outputs) */
.energy-products .energy-cofactor-edge {
    stroke-dasharray: 3,3 !important;
}

.energy-products .energy-product-edge {
    stroke-dasharray: 5,2 !important;
}

.energy-tooltip {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* D3 Edge Label Styles - Temporarily disabled */
/*
.edge-label text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-weight: 600;
    text-shadow: 
        1px 1px 2px rgba(255, 255, 255, 0.8),
        -1px -1px 2px rgba(255, 255, 255, 0.8),
        1px -1px 2px rgba(255, 255, 255, 0.8),
        -1px 1px 2px rgba(255, 255, 255, 0.8);
    letter-spacing: 0.02em;
}

.edge-label textPath {
    font-size: 11px;
    fill: #047857;
}
*/

/* Edge tooltip enhancement */
.edge-tooltip {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Ensure modal appears above everything */
.compound-modal-overlay {
    z-index: 10000 !important;
}

/* Better responsive behavior for modal */
@media (max-width: 480px) {
    .compound-modal {
        margin: 5px;
        border-radius: 15px;
    }
    
    .compound-modal-title {
        font-size: 1.4rem;
    }
}

/* Chemical Structure Tooltip Styles */
.structure-tooltip {
    position: absolute;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    z-index: 1000;
    max-width: 350px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.structure-tooltip:hover {
    opacity: 1;
    transform: translateY(0);
}

.structure-tooltip h4 {
    margin: 0 0 8px 0;
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.structure-tooltip img {
    max-width: 300px;
    max-height: 250px;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.structure-tooltip p {
    margin: 8px 0 0 0;
    color: #6b7280;
    font-size: 12px;
    font-style: italic;
    text-align: center;
}

/* Enhanced Node Label Styles */
.node-label {
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    font-weight: 700;
    letter-spacing: 0.025em;
}
