/*!
 * memory_graph_web
 * Description: Online debugger tool for Python code using memory_graph  
 * for visualization of data on the call stack.
 * 
 * @copyright (c) 2025 Bas Terwijn. All rights reserved.
 * 
 * This file, its source code, and its functionality are the proprietary
 * property of Bas Terwijn and are protected by copyright law. You are
 * granted no right to reproduce, distribute, or create derivative works
 * from this code without explicit permission.
 * 
 * For inquiries, contact: bterwijn@gmail.com
 * Terms of Service: https://memory-graph.com/terms
 */

/* Import friendly font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Apply friendly font to all elements */
html, body, * {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

/* Preserve original font for SVG container and its contents */
#svg-container, #svg-container * {
    font-family: initial !important;
}

/* Preserve original font for CodeMirror editor */
.CodeMirror, .CodeMirror * {
    font-family: monospace !important;
}

html, body { height: 100%; margin: 0; }

#full-page { height: calc(100vh - 26px); display: flex; flex-direction: row; }
#left-side { flex: 0 0 50%; min-width: 8px; display: flex; flex-direction: column; }
#right-side { flex: 1 1 auto; min-width: 8px; display: flex; flex-direction: column; }

#footer {
    height: 26px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #6c757d;
}

#footer a {
    color: #6c757d;
    text-decoration: none;
}

#footer a:hover {
    text-decoration: underline;
}

#divider-horizontal { width: 8px; min-width: 8px; background: #ddd; cursor: col-resize; z-index: 1000; position: relative; }
#divider-horizontal:hover { background: #cfcfcf; }
#divider-vertical-left { height: 8px; min-height: 8px; background: #ddd; cursor: row-resize; z-index: 1000; position: relative; }
#divider-vertical-left:hover { background: #cfcfcf; }
#divider-vertical-right { height: 8px; min-height: 8px; background: #ddd; cursor: row-resize; z-index: 1000; position: relative; }
#divider-vertical-right:hover { background: #cfcfcf; }

#left-top { flex: 0 0 20%; min-height: 8px; display: flex; flex-direction: column;}
#left-bottom { flex: 1 1 auto; min-height: 8px; display: flex; flex-direction: column; }
#right-top { flex: 0 0 75%; min-height: 8px; display: flex; flex-direction: column; }
#right-bottom { flex: 1 1 auto; min-height: 8px; display: flex; flex-direction: column;}

#header-row {
    display: flex;
    align-items: center;
    padding: 5px;
    position: relative;
}

#get_url {
    position: absolute;
    left: 10px;
    z-index: 1;
}

#title {
    text-align: center;
    flex-grow: 1;
}

#title h3 {margin:4px;}
#log {width: 100%; height: 100%; box-sizing: border-box; resize: none;}

/* Debug Buttons Layout */
#debug-buttons {
    padding: 5px;
    background: #f7f7f7;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.debug-left {
    display: flex;
    gap: 8px;
    align-items: center;
}

.debug-right {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}

#timestep {
    width: 40px;
    text-align: right;
}

/* SVG Viewer Styles */
#image-buttons {
    padding: 5px;
    background: #f7f7f7;
    border-bottom: 1px solid #ddd;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;  /* Aligns items to the right */
    position: relative;
    z-index: 1000;  /* Always on top like dividers */
}

#image-buttons button {
    padding: 3px 8px;
    cursor: pointer;
}

#svg-zoom-info {
    margin-left: 10px;  /* Give some space after the last button */
    color: #666;
    font-size: 12px;
    min-width: 40px;    /* Fixed minimum width */
    text-align: right;  /* Right-align the text within the fixed width */
    display: inline-block; /* Ensure width property is respected */
}

#svg-viewer {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #fff;
    min-height: 0;
    display: flex;
}

#svg-container {
    position: relative;
    overflow: hidden; /* Changed from 'auto' to 'hidden' to remove scrollbars */
    flex: 1;
    cursor: grab;
}

#svg-container:active {
    cursor: grabbing;
}

#svg-container svg {
    display: block;
    transform-origin: 0 0;
}
#code-wrap {flex: 1 1 auto; min-height: 0; display: flex; }
#code {width:100%;height:100%}
#output {width: 100%; height: 100%; box-sizing: border-box; resize: none;}

.CodeMirror { border: 1px solid #ddd; height: 100%; width: 100%; }
.CodeMirror-gutters { border-right: 1px solid #ddd; background: #f7f7f7; }
.breakpoints { width: 1.2em; }
.breakpoint { color: #d00; font-size: 16px; line-height: 16px; }
.current-line { background: rgba(255, 230, 180, 0.7); }

/* Simulated pressed button styling */
.sim-pressed {
    background-color: #d4d4d4 !important;
    border-color: #adadad !important;
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125) !important;
    transform: translateY(1px);
    transition: all 0.05s ease;
}

/* Custom button colors for animate/play/pause */
#animate.btn-warning {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #000 !important;
}

#animate.btn-warning:hover:not(:disabled) {
    background-color: #e0a800 !important;
    border-color: #d39e00 !important;
    color: #000 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.15s ease;
}

#animate.paused {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #fff !important;
}

#animate.paused:hover:not(:disabled) {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.15s ease;
}

/* Enhanced hover effects for all buttons */
.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.15s ease;
}

.btn-primary:hover:not(:disabled) {
    background-color: #0056b3 !important;
    border-color: #004085 !important;
}

.btn-success:hover:not(:disabled) {
    background-color: #1e7e34 !important;
    border-color: #1c7430 !important;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #545b62 !important;
    border-color: #4e555b !important;
}

.btn-danger:hover:not(:disabled) {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
}

.btn-outline-secondary:hover:not(:disabled) {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
}

/* Cookie Consent Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 20px;
    z-index: 10000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.cookie-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px;
}

.cookie-text {
    flex: 1;
}

.cookie-text p {
    margin: 0;
    line-height: 1.4;
}

.cookie-text p:first-child {
    margin-bottom: 5px;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .cookie-buttons {
        justify-content: center;
    }
}
