:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #2a9d8f;
    --danger-color: #e63946;
    --dark-color: #1d3557;
    --light-color: #f1faee;
    --gray-color: #e5e5e5;
    --dark-gray: #6c757d;
    
    --lead-color: #4cc9f0;
    --salespage-color: #4895ef;
    --checkout-color: #4361ee;
    --upsell-color: #3f37c9;
    --downsell-color: #3a0ca3;
    --thankyou-color: #2a9d8f;
    --email-color: #f77f00;
    
    --sidebar-width: 280px;
    --toolbar-height: 60px;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: #f8f9fa;
    color: var(--dark-color);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background-color: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.logo {
    padding: 20px;
    border-bottom: 1px solid var(--gray-color);
    text-align: center;
}

.logo h1 {
    font-size: 24px;
    color: var(--primary-color);
}

.tools-container {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
}

.tools-container h2 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--dark-gray);
}

.block-templates {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.block-template {
    display: flex;
    align-items: center;
    padding: 12px;
    background-color: white;
    border: 1px solid var(--gray-color);
    border-radius: 5px;
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
}

.block-template:hover {
    background-color: #f0f2f5;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.block-template i {
    margin-right: 10px;
    font-size: 16px;
}

.block-template[data-type="lead"] i { color: var(--lead-color); }
.block-template[data-type="salespage"] i { color: var(--salespage-color); }
.block-template[data-type="checkout"] i { color: var(--checkout-color); }
.block-template[data-type="upsell"] i { color: var(--upsell-color); }
.block-template[data-type="downsell"] i { color: var(--downsell-color); }
.block-template[data-type="thankyou"] i { color: var(--thankyou-color); }
.block-template[data-type="email"] i { color: var(--email-color); }

.actions {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid var(--gray-color);
}

/* Editor Area Styles */
.editor-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.toolbar {
    height: var(--toolbar-height);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: white;
    border-bottom: 1px solid var(--gray-color);
}

.file-name input {
    font-size: 16px;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 4px;
    background-color: transparent;
}

.file-name input:focus {
    border-color: var(--primary-color);
    outline: none;
    background-color: white;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.canvas-container {
    flex-grow: 1;
    overflow: auto;
    position: relative;
    background-color: #f0f2f5;
}

.canvas {
    width: 3000px;
    height: 2000px;
    position: relative;
    background-color: #f8f9fa;
    background-image: 
        linear-gradient(rgba(200, 200, 200, 0.2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(200, 200, 200, 0.2) 1px, transparent 1px);
    background-size: 20px 20px;
    transform-origin: 0 0;
}

/* Blocks on Canvas */
.funnel-block {
    position: absolute;
    width: 180px;
    background-color: white;
    border-radius: 5px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: move;
    z-index: 1;
    user-select: none;
}

.funnel-block .block-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.funnel-block .block-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    margin-right: 10px;
}

.funnel-block .block-title {
    font-weight: 600;
    font-size: 14px;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.funnel-block .edit-block {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    font-size: 12px;
}

.funnel-block .edit-block:hover {
    opacity: 1;
}

.funnel-block .connection-point {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--dark-gray);
    position: absolute;
    cursor: pointer;
    z-index: 2;
}

.funnel-block .connection-point.input {
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
}

.funnel-block .connection-point.output {
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
}

.funnel-block .connection-point:hover {
    background-color: var(--primary-color);
    transform: translateX(-50%) scale(1.2);
}

/* Connector Lines */
.connector {
    position: absolute;
    z-index: 0;
    pointer-events: none;
}

.connector.selected {
    stroke: var(--primary-color);
    stroke-width: 3px;
}

.connector-handle {
    position: absolute;
    width: 15px;
    height: 15px;
    background-color: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    pointer-events: all;
    z-index: 3;
}

/* Temporary connection line while drawing */
.temp-connector {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    stroke: var(--primary-color);
    stroke-width: 2px;
    stroke-dasharray: 5,5;
}

/* Button Styles */
.btn {
    padding: 8px 15px;
    border-radius: 4px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn i {
    font-size: 16px;
}

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

.btn.primary:hover {
    background-color: var(--secondary-color);
}

.btn.secondary {
    background-color: white;
    color: var(--dark-color);
    border: 1px solid var(--gray-color);
}

.btn.secondary:hover {
    background-color: var(--gray-color);
}

.btn.danger {
    background-color: white;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.btn.danger:hover {
    background-color: var(--danger-color);
    color: white;
}

.btn.icon-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 25px;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.close-modal {
    float: right;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--gray-color);
    border-radius: 4px;
}

.form-group textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 40vh;
    }
    
    .editor-area {
        height: 60vh;
    }
}

