/* Modern Floor Plan Designer Styling */

/* Global Styles */
* {
    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%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Header */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 20px 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 300;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
    margin-top: 8px;
    opacity: 0.9;
    font-size: 1rem;
}

/* View Controls */
#view-controls {
    background: #f8f9fa;
    padding: 15px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.view-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    background: white;
    color: #495057;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.view-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.view-btn:hover::before {
    left: 100%;
}

.view-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.view-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Toolbar */
#toolbar {
    background: white;
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.tool-btn {
    padding: 12px 20px;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    background: white;
    color: #495057;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.tool-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transition: width 0.3s ease;
    z-index: 0;
}

.tool-btn span {
    position: relative;
    z-index: 1;
}

.tool-btn:hover::before {
    width: 100%;
}

.tool-btn:hover {
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.tool-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.tool-btn.active::before {
    width: 100%;
}

/* Special styling for different tool types */
.tool-btn[id*="wall"] {
    border-color: #28a745;
}

.tool-btn[id*="wall"]:hover,
.tool-btn[id*="wall"].active {
    background: linear-gradient(135deg, #28a745, #20c997);
    border-color: #28a745;
}

.tool-btn[id*="door"] {
    border-color: #fd7e14;
}

.tool-btn[id*="door"]:hover,
.tool-btn[id*="door"].active {
    background: linear-gradient(135deg, #fd7e14, #ff8c42);
    border-color: #fd7e14;
}

.tool-btn[id*="window"] {
    border-color: #17a2b8;
}

.tool-btn[id*="window"]:hover,
.tool-btn[id*="window"].active {
    background: linear-gradient(135deg, #17a2b8, #20c997);
    border-color: #17a2b8;
}

.tool-btn[id*="export"],
.tool-btn[id*="load"],
.tool-btn[id*="detect"] {
    border-color: #6f42c1;
}

.tool-btn[id*="export"]:hover,
.tool-btn[id*="export"].active,
.tool-btn[id*="load"]:hover,
.tool-btn[id*="load"].active,
.tool-btn[id*="detect"]:hover,
.tool-btn[id*="detect"].active {
    background: linear-gradient(135deg, #6f42c1, #8b5fbf);
    border-color: #6f42c1;
}

/* Canvas Container */
#canvas-container {
    padding: 30px;
    background: #f8f9fa;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 600px;
}

#canvas, #three-container {
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    background: white;
    border: 3px solid white;
}

#three-container {
    background: #f0f0f0;
}

/* Status Bar (optional - add this to your HTML) */
.status-bar {
    background: #343a40;
    color: white;
    padding: 10px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    #toolbar {
        padding: 15px;
        justify-content: flex-start;
    }
    
    .tool-btn {
        padding: 10px 15px;
        font-size: 12px;
    }
    
    #canvas-container {
        padding: 15px;
    }
    
    #canvas, #three-container {
        max-width: 100%;
        height: auto;
    }
}

/* Hover effects for canvas */
#canvas {
    transition: all 0.3s ease;
}

#canvas:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Loading animation (optional) */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Tooltip styling (optional enhancement) */
.tool-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

/* Glass morphism effect for modern look */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Success/Error notifications styling */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.notification.error {
    background: linear-gradient(135deg, #dc3545, #fd7e14);
}