body {
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    height: 100dvh;
    font-family: 'Roboto', sans-serif;
    background-color: #f0f4f8;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    overflow: hidden;
    }
    .size-controls{
    background-color: transparent;
    }
    .container {
    height: 100%;
    display: flex;
    align-items: stretch;
    gap: 20px;
    }
    .size {
    width: 50%;
    background-color: #edf2f7;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }
    .navbar-style {
    height: 55px;
    min-height: 55px;
    width: 100%;
    border-radius: 12px 12px 0 0;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 15px;
    box-sizing: border-box;
    }
    .editor-navbar {
    justify-content: space-between;
    }
    .editor-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    }
    .editor-btn {
    background-color: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
    }
    .editor-btn ion-icon {
    font-size: 16px;
    color: #6b7280;
    }
    .editor-btn:hover {
    background-color: #f9fafb;
    border-color: #adb5bd;
    }
    #editor-container {
    width: 100%;
    height: calc(100% - 55px);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    font-family: monospace !important;
    }
    .navbar2 {
    justify-content: space-between;
    gap: 10px;
    padding: 0 10px;
    }
    .preview-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    }
    .preview-bar-wrapper {
    border: 1px solid #e5e7eb;
    border-radius: 30px;
    height: 30px;
    width: auto;
    padding: 0 15px;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    cursor: default;
    background-color: #edf2f7;
    }
    .loader {
    height: 10px;
    width: 10px;
    border: 2px solid red;
    border-top-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    .mini{
    height: 6px;
    width: 6px;
    background-color: red;
    border-radius: 50%;
    }
    }
    .preview-bar p {
    font-weight: 500;
    font-size: 13px;
    margin: 0;
    color: #4b5563;
    }
    @keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
    }
    .terminal-controls {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    }
    .terminal {
    border: 1px solid #e5e7eb;
    padding: 4px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    color: #4b5563;
    background-color: #fff;
    }
    .terminal rect { transition: fill 0.2s ease; }
    .terminal text { transition: fill 0.2s ease; }
    .terminal:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
    }
    .terminal:active {
    background-color: #f3f4f6;
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.05);
    }
    .terminal:active rect { fill: #374151; }
    .terminal:active text { fill: #f9fafb; }
    .force-refresh {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    }
    .force-refresh p {
    height: 28px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    margin: 0;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
    background-color: #fff;
    color: #374151;
    }
    .force-refresh p:hover {
    background-color: #f9fafb;
    border-color: #adb5bd;
    }
    .force-refresh p:active {
    background-color: #f3f4f6;
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.05);
    }
    .external-preview {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    }
    .preview-tab-btn ion-icon {
    font-size: 16px;
    }
    .download {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    }
    .download svg {
    display: block;
    width: 20px;
    height: 20px;
    }
    .download svg path {
    stroke: #6b7280;
    transition: stroke 0.2s ease;
    }
    .download:hover {
    background-color: #f3f4f6;
    }
    .download:active {
    background-color: #e5e7eb;
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.05);
    }
    .preview-part {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    overflow: hidden;
    background-color: #edf2f7;

    }
    #preview-box {
    position: relative;
    width: 85%;
    max-width: 100%;
    min-width: 250px;
    height: 85%;
    max-height: 100%;
    min-height: 200px;
    background-color: #4a4a4a;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    transition: width 0.2s ease, height 0.2s ease;
    }
    #preview-iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
    background-color: #ffffff;
    }
    .resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 12px;
    cursor: ew-resize;
    z-index: 10;
    display: flex;
    align-items: center;

    background-color: transparent;
    transition: background-color 0.2s ease;

    }
    .resize-handle::before {
    content: '';
    display: block;
    width: 2px;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 1px;
    transition: background-color 0.2s ease, height 0.2s ease;
    opacity: 0;
    }

    #preview-box:hover .resize-handle::before {
    opacity: 1;
    }
    .resize-handle:hover::before {
    background-color: rgba(255, 255, 255, 0.7);
    height: 40px;
    }
    .resize-handle:active::before {
    background-color: rgba(255, 255, 255, 1);
    height: 50px;
    }
    .resize-handle:active {

    background-color: rgba(0, 0, 0, 0.1);

    }
    .resize-handle-left {
    left: 0;
    justify-content: flex-start;
    padding-left: 5px;
    }
    .resize-handle-right {
    right: 0;
    justify-content: flex-end;
    padding-right: 5px;
    }
    #terminal {
    width: 100%;
    max-height: 40%;
    min-height: 80px;
    border-radius: 0 0 12px 12px;
    background-color: #282c34;

    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    border-top: 1px solid #4b5263;

    }
    .terminal-nav {
    font-weight: 500;
    color: #abb2bf;
    height: 35px;
    min-height: 35px;
    width: 100%;
    align-items: center;
    padding: 0 15px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    background-color: #3a3f4b;
    border-bottom: 1px solid #4b5263;
    font-size: 13px;
    user-select: none;
    }
    .terminal-nav p:last-child {
    cursor: pointer;
    padding: 0 8px;
    line-height: 20px;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 16px;
    font-weight: bold;
    }
    .terminal-nav p:last-child:hover {
    background-color: #5c6370;
    color: #ffffff;
    }
    .terminal-content {
    flex-grow: 1;
    padding: 10px 15px;
    color: #abb2bf;
    font-family: 'Menlo', 'Monaco', 'Courier New', Courier, monospace;
    font-size: 13px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    }
    .terminal-content div {
    padding: 2px 0;
    border-bottom: 1px dotted #3a3f4b;
    }
    .terminal-content div:last-child {
    border-bottom: none;
    }
    .mobile-toggle-bar{
    display: none;
    }
    .terminal-entry-log { color: #abb2bf; }
    .terminal-entry-error { color: #e06c75;  }
    .terminal-entry-warn { color: #e5c07b;  }
    .terminal-entry-info { color: #61afef;  }

    @media (max-width: 768px) {
        body {
            padding: 0; 
            overflow-y: auto; 
        }
        .container {
            flex-direction: column; 
            height: auto; 
            margin-bottom: 50px; 
            gap: 0; 
        }
        .size {
            width: 100%; 
            height: calc(100dvh - 50px); 
            border-radius: 0; 
            border: none; 
            box-shadow: none; 
        }
        .navbar-style {
            border-radius: 0; 
            border-left: none; 
            border-right: none; 
        }
        .editor-navbar {
            border-bottom: 1px solid #e2e8f0; 
        }
        #editor-container {
            border-radius: 0; 
            height: calc(100% - 55px); 
        }
        .preview-part {
            padding: 0; 
            background-color: transparent; 
        }
        #preview-box {
            border-radius: 20px; 
            width: 90%; 
            height: 90%; 
            box-shadow: none; 
            background-color: transparent; 
        }
        #terminal {
            border-radius: 0; 
            max-height: 50vh; 
        }

        .mobile-toggle-bar {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 50px;
            background-color: #f0f4f8; 
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid #e2e8f0;
            box-shadow: 0px -2px 5px rgba(0,0,0,0.05);
            z-index: 100; 
        }
        .mobile-toggle-btn {
            background: none;
            border: none;
            padding: 8px 15px;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 500;
            color: #374151;
            transition: background-color 0.2s ease;
        }
        #refresh-btn{
          display: none;
        }
        .mobile-toggle-btn.active,
        .mobile-toggle-btn:hover {
            background-color: #e2e8f0; 
        }
    }

    @media (max-width: 768px) {
        .preview.size {
            display: flex;
        }
        .editor.size {
            display: none;
        }
    }
    .resize-handle {
        position: absolute;
        background-color: #ccc; 
        opacity: 0; 
        transition: opacity 0.2s ease; 
    }
    .resize-handle:hover {
        opacity: 1; 
        background-color: #999; 
        cursor: ew-resize; 
    }
    .preview-box:hover .resize-handle {
        opacity: 0.5; 
    }
    .resize-handle-left, .resize-handle-right {
        top: 0;
        width: 5px; 
        height: 100%;
        cursor: ew-resize;
    }
    .resize-handle-left {
        left: 0;
    }
    .resize-handle-right {
        right: 0;
    }
    .resize-handle-top, .resize-handle-bottom {
        left: 0;
        height: 5px; 
        width: 100%;
        cursor: ns-resize;
    }
    .resize-handle-top {
        top: 0;
    }
    .resize-handle-bottom {
        bottom: 0;
    }
    .resize-handle:hover.resize-handle-top,
    .resize-handle:hover.resize-handle-bottom {
        cursor: ns-resize; 
    }

    .preview-box {
        position: relative; 
    }
    .preview-part{
      position: relative;
    }
    .size-controls.left {
        position: absolute; 
        top: 0px; 
        left: 0px; 
        display: flex;
        align-items: center;
        background-color: rgba(255, 255, 255, 0.8); 
        padding: 5px 10px;
        border-radius: 5px;

        z-index: 10; 
    }
    .dimension-input {
        display: flex;
        align-items: center;
        margin-right: 10px; 
    }
    .dimension-input label {
        font-size: 0.85em; 
        color: #374151;
        margin-right: 3px; 
    }
    .dimension-input input[type="number"] {
        width: 50px; 
        padding: 4px; 
        border: 1px solid #e2e8f0;
        border-radius: 4px;
        font-size: 0.85em; 
    }
    #python-terminal{
        height: 100%;
        width: 100%;
        background-color: black;
        display: none;
        color: white;
        flex-direction: column;
        gap: 10px;
        font-size: 14px;
        font-weight: bold;
        padding: 20px;
        box-sizing: border-box;
        .terminal-output-log{
            display: flex;
            align-items: center;
            width: 100%;
            height: auto;
            gap: 5px;
        }
        #adress{
            font-weight: 500;
            color: #55c6fa;
        }
    }
