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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    height: 100svh; /* Use small viewport height for mobile */
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.container {
    width: 100%;
    height: 100vh;
    height: 100svh; /* Use small viewport height for mobile */
    display: flex;
    flex-direction: column;
    padding: 10px;
    box-sizing: border-box;
}

.canvas-container {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    cursor: crosshair;
    background: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin-bottom: 15px;
    transition: all 0.3s ease;
    min-height: 0; /* Important for flex-grow to work properly */
}

#parkingCanvas {
    width: 100%;
    height: 100%;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    border-radius: 13px;
}

.canvas-container.panning {
    cursor: grabbing;
}

.controls {
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: all 0.3s ease;
    flex-shrink: 0; /* Prevent controls from shrinking */
    
    /* Mobile optimization */
    position: relative;
    z-index: 10;
}

/* Mobile responsive */
@media (max-width: 768px) {
    body {
        height: 100svh; /* Force small viewport height on mobile */
    }
    
    .container {
        padding: 8px;
        height: 100svh; /* Force small viewport height on mobile */
    }
    
    .canvas-container {
        flex-grow: 1;
        margin-bottom: 10px;
        min-height: 0;
    }
    
    .controls {
        padding: 15px;
        flex-shrink: 0;
        flex-wrap: wrap;
        justify-content: space-around;
        /* Height will be determined by content + padding */
    }
}

.confirm-btn {
    padding: 12px 24px;
    font-size: 16px;
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.confirm-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    background: linear-gradient(45deg, #218838, #1ea475);
}

.confirm-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3);
}

.confirm-btn:disabled {
    background: linear-gradient(45deg, #6c757d, #adb5bd);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.2);
}

.help-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(45deg, #6f42c1, #e83e8c);
    color: white;
    border: none;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(111, 66, 193, 0.3);
    position: relative;
    overflow: hidden;
}

.help-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(111, 66, 193, 0.4);
    background: linear-gradient(45deg, #5a2d91, #dc3545);
}

.help-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(111, 66, 193, 0.3);
}

.help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.help-overlay.hidden {
    display: none;
}

.help-content {
    background: white;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    margin: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
}

.help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.help-header h3 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.close-btn:hover {
    background-color: #f5f5f5;
    color: #333;
}

.help-content p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 16px;
}

.help-instructions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-instructions li {
    padding: 8px 0;
    color: #555;
    border-bottom: 1px solid #f0f0f0;
}

.help-instructions li:last-child {
    border-bottom: none;
}

.help-instructions strong {
    color: #333;
    margin-right: 8px;
}

.message-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.message-overlay.hidden {
    display: none;
}

.message-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    max-width: 400px;
    margin: 20px;
    animation: slideIn 0.3s ease;
}

.message-overlay.success .message-content {
    border-left: 5px solid #28a745;
    color: #155724;
}

.message-overlay.error .message-content {
    border-left: 5px solid #dc3545;
    color: #721c24;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

