/* PhaseFlow Compiler Styles */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
}

/* Global Styles */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.container-fluid {
    max-width: 1400px;
}

/* Header Styles */
h1 {
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-weight: 300;
}

h1 small {
    font-size: 0.5em;
    opacity: 0.8;
}

/* Card Enhancements */
.card {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.card-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    border-bottom: none;
    font-weight: 500;
}

/* Phase Navigation */
.phase-nav {
    background: rgba(255,255,255,0.95);
    border-radius: 50px;
    padding: 8px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.phase-nav .nav-link {
    border-radius: 40px;
    padding: 12px 20px;
    margin: 0 2px;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--dark-color);
    border: 2px solid transparent;
}

.phase-nav .nav-link:hover {
    background: rgba(0,123,255,0.1);
    border-color: var(--primary-color);
}

.phase-nav .nav-link.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0,123,255,0.3);
}

/* Token Styling */
.token-list .badge {
    font-size: 0.9em;
    padding: 8px 12px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--secondary-color), #495057);
    transition: transform 0.2s ease;
}

.token-list .badge:hover {
    transform: scale(1.05);
}

/* D3.js Tree Styling */
.tree-container {
    width: 100%;
    height: 500px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    overflow: visible;
    position: relative;
}

/* Variable Mapping Table */
.variable-mapping {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #dee2e6;
}

.variable-mapping .table {
    margin: 0;
    font-size: 0.9em;
}

.variable-mapping code {
    background: rgba(0, 123, 255, 0.1);
    color: #0056b3;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.tree-container svg {
    width: 100%;
    height: 100%;
    font-family: Arial, sans-serif;
}

.node circle {
    stroke: #333;
    stroke-width: 2px;
    cursor: pointer;
}

.node text {
    font-size: 12px;
    font-weight: bold;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
}

.node.operator circle {
    fill: #ff6b6b;
}

.node.operator text {
    fill: white;
}

.node.identifier circle {
    fill: #4ecdc4;
}

.node.identifier text {
    fill: white;
}

.node.number circle {
    fill: #45b7d1;
}

.node.number text {
    fill: white;
}

.node.conversion circle {
    fill: #9b59b6;
}

.node.conversion text {
    fill: white;
}

.link {
    fill: none;
    stroke: #666;
    stroke-width: 2px;
}

.type-annotation {
    font-size: 10px;
    font-weight: normal;
    fill: #666;
}

/* Responsive adjustments for D3 trees */
@media (max-width: 768px) {
    .tree-container {
        height: 400px;
    }
    
    .node text {
        font-size: 10px;
    }
    
    .type-annotation {
        font-size: 8px;
    }
    
    .node circle {
        stroke-width: 1.5px;
    }
    
    .variable-mapping {
        margin-top: 20px;
        padding: 10px;
    }
    
    .variable-mapping .table {
        font-size: 0.8em;
    }
}

@media (max-width: 576px) {
    .tree-container {
        height: 350px;
    }
    
    .node text {
        font-size: 9px;
    }
    
    .type-annotation {
        font-size: 7px;
    }
    
    .variable-mapping {
        padding: 8px;
    }
    
    .variable-mapping .table {
        font-size: 0.75em;
    }
}

/* Type Annotations */
.type-annotation {
    display: inline-block;
    font-size: 0.8em;
    color: var(--info-color);
    font-weight: bold;
    background: rgba(23, 162, 184, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 4px;
    border: 1px solid rgba(23, 162, 184, 0.3);
}

/* Code Blocks */
pre {
    background: #1a202c !important;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.3);
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.5;
    border: 1px solid #4a5568;
}

.bg-light {
    background: #1a202c !important;
    color: #e2e8f0 !important;
}

.bg-dark {
    background: linear-gradient(135deg, #2d3748, #1a202c) !important;
}

.text-light {
    color: #e2e8f0 !important;
}

/* Table Enhancements */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.table {
    margin: 0;
}

.table th {
    background: linear-gradient(135deg, var(--dark-color), #495057);
    color: white;
    border: none;
    font-weight: 500;
}

.table td {
    border-color: #dee2e6;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: rgba(0,123,255,0.05);
}

/* Alert Enhancements */
.alert {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
    border-left: 4px solid var(--danger-color);
}

/* Button Enhancements */
.btn {
    border-radius: 25px;
    padding: 12px 30px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Optimization List */
.list-unstyled li {
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.list-unstyled li:last-child {
    border-bottom: none;
}

.list-unstyled i {
    margin-right: 8px;
}

/* Form Enhancements */
.form-control {
    border-radius: 8px;
    border: 2px solid #dee2e6;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* Animation Classes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .phase-nav .nav-link {
        font-size: 0.85em;
        padding: 8px 12px;
    }
    
    .parse-tree {
        font-size: 0.8em;
    }
    
    pre {
        font-size: 0.8em;
    }
    
    .node-value {
        padding: 4px 8px;
        font-size: 0.9em;
    }
}

@media (max-width: 576px) {
    .phase-nav {
        padding: 4px;
    }
    
    .phase-nav .nav-link {
        font-size: 0.75em;
        padding: 6px 8px;
        margin: 1px;
    }
    
    .btn {
        padding: 10px 20px;
    }
} 