/* Floor Plan Manager Styles */
.floor-plan-manager-container {
    padding: 20px;
    width: 100%;
    max-width: none;
    margin: 0;
    min-height: 100vh;
    background: var(--bg-primary, #f8fafc);
}

/* Loading Container */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--bg-primary);
    gap: 16px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-container p {
    color: var(--text-muted);
    font-size: 14px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 24px;
    background: var(--bg-card, white);
    border-radius: 16px;
    box-shadow: var(--shadow-card, 0 4px 20px rgba(0, 0, 0, 0.08));
}

.page-header-content h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary, #1a1a2e);
    margin: 0 0 8px 0;
}

.page-header-content p {
    color: var(--text-secondary, #64748b);
    margin: 0;
    font-size: 15px;
}

.page-header-actions {
    display: flex;
    gap: 12px;
}

.floor-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 8px;
    background: var(--bg-card, white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm, 0 2px 10px rgba(0, 0, 0, 0.05));
}

.floor-tab {
    padding: 12px 24px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    transition: all 0.2s ease;
}

.floor-tab:hover {
    background: var(--bg-tertiary, #f1f5f9);
    color: var(--accent-primary, #4A90E2);
    transform: translateY(-1px);
}

.floor-tab.active {
    background: var(--accent-primary, #4A90E2);
    color: white;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.floor-plan-editor {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Helper Banner */
.helper-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-tertiary, #f1f5f9);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    color: var(--text-secondary, #64748b);
    font-size: 14px;
    line-height: 1.5;
}

.helper-banner svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.helper-text {
    flex: 1;
}

.helper-text span {
    font-weight: 500;
}

/* Enhanced Action Bar - similar to POS stats bar */
.editor-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-card, white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.08));
    gap: 15px;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--bg-card, white);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #334155);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.toolbar-btn svg {
    flex-shrink: 0;
}

.toolbar-btn span {
    flex-shrink: 0;
}

.toolbar-btn:hover {
    background: var(--bg-tertiary, #f8fafc);
    border-color: var(--accent-primary, #4A90E2);
    color: var(--accent-primary, #4A90E2);
}

.toolbar-btn.active {
    background: var(--accent-primary, #4A90E2);
    border-color: var(--accent-primary, #4A90E2);
    color: white;
}

.toolbar-btn.danger {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
}

.toolbar-btn.danger:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-color: #dc2626;
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.3);
}

.floor-plan-canvas-container {
    background: var(--bg-card, white);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-card, 0 4px 20px rgba(0, 0, 0, 0.08));
    overflow: auto;
}

.floor-plan-canvas {
    position: relative;
    background-color: var(--bg-tertiary, #f8fafc);
    background-image: 
        linear-gradient(rgba(148, 163, 184, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    user-select: none;
    cursor: crosshair;
}

/* Dining Area Styles */
.dining-area-element {
    position: absolute;
    cursor: move;
    transition: all 0.2s ease;
    user-select: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dining-area-element:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.dining-area-element.selected {
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.4), 0 6px 20px rgba(74, 144, 226, 0.25);
    transform: translateY(-1px);
}

.area-label {
    pointer-events: none;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Resize Handles */
.resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: white;
    border: 2px solid var(--primary-color, #4A90E2);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.resize-handle:hover {
    width: 16px;
    height: 16px;
    background: var(--primary-color, #4A90E2);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.4);
}

.resize-handle.nw {
    top: -6px;
    left: -6px;
    cursor: nw-resize;
}

.resize-handle.ne {
    top: -6px;
    right: -6px;
    cursor: ne-resize;
}

.resize-handle.sw {
    bottom: -6px;
    left: -6px;
    cursor: sw-resize;
}

.resize-handle.se {
    bottom: -6px;
    right: -6px;
    cursor: se-resize;
}

/* Table Styles */
.table-element {
    position: absolute;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 3px solid #4A90E2;
    font-weight: 700;
    font-size: 18px;
    color: #1e293b;
    transition: all 0.2s ease;
    user-select: none;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
}

.table-element:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.3);
    border-width: 4px;
}

.table-element.selected {
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.4), 0 6px 20px rgba(74, 144, 226, 0.35);
    border-width: 4px;
    transform: scale(1.05);
}

/* Proper table shape rendering */
.table-rectangle {
    border-radius: 10px;
}

.table-round {
    border-radius: 50%;
}

.table-square {
    border-radius: 8px;
}

.table-oval {
    border-radius: 50%;
}

.table-number {
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.empty-state svg {
    color: #cbd5e1;
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 18px;
    color: #64748b;
    margin-bottom: 24px;
    font-weight: 500;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-dialog {
    position: relative;
    z-index: 1001;
    background: var(--bg-card, #1a1a2e);
    border-radius: 20px;
    width: 90%;
    max-width: 560px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-bottom: none;
}

.modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 24px;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 32px 28px;
    background: var(--bg-secondary, #1e1e2a);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 24px 28px;
    background: var(--bg-card, #1a1a2e);
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

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

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    letter-spacing: 0.2px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    font-size: 15px;
    background: var(--bg-input, rgba(255, 255, 255, 0.05));
    color: var(--text-primary, #ffffff);
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary, #6366f1);
    background: var(--bg-tertiary, #252530);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.form-group input::placeholder {
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
}

.form-group input[type="color"] {
    height: 52px;
    cursor: pointer;
    padding: 6px;
}

.form-group input[type="number"] {
    -moz-appearance: textfield;
}

.form-group input[type="number"]::-webkit-outer-spin-button,
.form-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .floor-plan-editor {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .floor-tabs {
        overflow-x: auto;
    }
    
    .editor-action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-group {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .floor-plan-canvas-container {
        overflow-x: scroll;
    }
    
    .toolbar-btn {
        flex: 1;
        justify-content: center;
        min-width: 140px;
    }
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color, #4A90E2) 0%, #357abd 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.3);
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background: #d1d5db;
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.3);
}

/* Dragging State */
.dining-area-element.dragging,
.table-element.dragging {
    opacity: 0.7;
    transform: scale(1.05);
    z-index: 1000;
    cursor: grabbing !important;
}

/* Light Theme Overrides */
[data-theme="light"] .modal-dialog {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .modal-body {
    background: #f9fafb;
}

[data-theme="light"] .modal-footer {
    background: #ffffff;
    border-top-color: #e5e7eb;
}

[data-theme="light"] .form-group label {
    color: #1e293b;
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group select {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #1e293b;
}

[data-theme="light"] .form-group input:focus,
[data-theme="light"] .form-group select:focus {
    background: #f9fafb;
    border-color: #6366f1;
}

[data-theme="light"] .form-group input::placeholder {
    color: #94a3b8;
}