/* ========================================
   Online WKT Viewer - Styles
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #fafafa;
    color: #212121;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
    flex-direction: column;
}

/* ========================================
   Header
   ======================================== */
header {
    background: #ffffff;
    border-bottom: 2px solid #e0e0e0;
    padding: 12px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

header h1 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #212121;
    margin: 0;
}

header h1 .material-icons {
    font-size: 28px;
}

.header-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    vertical-align: middle;
    background: #ffffff;
    border-radius: 6px;
    padding: 2px;
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    width: 320px;
    background: #ffffff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    background: #fafafa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #D0021B;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.sidebar-header h2 .material-icons {
    font-size: 20px;
}

.sidebar-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #757575;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #f5f5f5;
    color: #D0021B;
}

.btn-icon .material-icons {
    font-size: 20px;
}

.geometry-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.geometry-item {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.geometry-item:hover {
    background-color: #f5f5f5;
}

.geometry-item.selected {
    background-color: #FFE8E8;
    color: #D0021B;
}

.geometry-item-info {
    flex: 1;
    min-width: 0;
}

.geometry-item-name {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.geometry-item-type {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 2px;
}

.geometry-item-actions {
    display: flex;
    gap: 6px;
    margin-left: 8px;
}

.geometry-item-actions button {
    background: none;
    border: none;
    color: #D0021B;
    cursor: pointer;
    padding: 4px 6px;
    font-size: 18px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.geometry-item-actions button:hover {
    transform: scale(1.2);
    color: #FF9800;
}

.geometry-item-actions .material-icons {
    font-size: 18px;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background-color: #D0021B;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #B80216;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(208, 2, 27, 0.3);
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #212121;
    flex: 1;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background-color: #e8e8e8;
}

.btn-danger {
    background-color: #EF4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn .material-icons {
    font-size: 18px;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}

/* ========================================
   Map Container
   ======================================== */
#map {
    flex: 1;
    background-color: #f3f4f6;
    position: relative !important;
}

/* ========================================
   Toolbar
   ======================================== */
.map-toolbar {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.map-toolbar .btn {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    background: transparent;
    border: none;
    color: #7C3AED;
    cursor: pointer;
}

.map-toolbar .btn-primary {
    background-color: transparent;
    color: #D0021B;
}

.map-toolbar .btn-primary:hover {
    background-color: #FFE8E8;
    transform: scale(1.1);
    box-shadow: none;
}

.map-toolbar .btn-secondary {
    background-color: transparent;
    color: #757575;
    border: none;
}

.map-toolbar .btn-secondary:hover {
    background-color: #f5f5f5;
}

.map-toolbar .material-icons {
    font-size: 24px;
    color: inherit;
}

.divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}

.map-toolbar .divider {
    display: none;
}

/* ========================================
   Zoom Info
   ======================================== */
.zoom-info {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 13px;
    font-weight: 500;
    color: #212121;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.zoom-info span {
    color: #D0021B;
    font-weight: 600;
    min-width: 20px;
    display: inline-block;
}

/* ========================================
   Modals
   ======================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #212121;
}

.modal-header button {
    background: none;
    border: none;
    color: #757575;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.modal-header button:hover {
    background-color: #f5f5f5;
    color: #212121;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ========================================
   Form Elements
   ======================================== */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #616161;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    background-color: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    color: #212121;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    transition: all 0.2s ease;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'Courier New', monospace;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #D0021B;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(208, 2, 27, 0.1);
}

.info-box {
    padding: 10px;
    background: #f0f9ff;
    border-radius: 6px;
    border-left: 4px solid #0ea5e9;
}

.info-box p {
    font-size: 12px;
    margin: 0;
    color: #1f2937;
}

/* ========================================
   Style Editor
   ======================================== */
.style-group {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 4px solid #D0021B;
}

.style-group label {
    color: #D0021B;
}

.style-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.style-row:last-child {
    margin-bottom: 0;
}

.color-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-input-wrapper input[type="color"] {
    width: 40px;
    height: 40px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
}

.color-input-wrapper input[type="text"] {
    flex: 1;
}

/* ========================================
   Projection Table
   ======================================== */
.projection-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 10px;
}

.projection-table th,
.projection-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.projection-table th {
    background-color: #f5f5f5;
    font-weight: 600;
    color: #D0021B;
}

.projection-table td {
    font-family: 'Courier New', monospace;
    word-break: break-all;
    color: #424242;
}

.projection-table .copy-btn {
    background: #D0021B;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    margin-left: 8px;
}

.projection-table .copy-btn:hover {
    background: #B80216;
}

/* ========================================
   Excel Import Styles
   ======================================== */
.modal-lg {
    max-width: 700px;
}

.file-upload-area {
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.file-upload-area:hover {
    border-color: #D0021B;
    background: #fff5f5;
}

.file-upload-area.drag-over {
    border-color: #D0021B;
    background: #fff5f5;
    transform: scale(1.02);
}

.file-upload-content p {
    margin: 10px 0 5px;
    font-size: 14px;
    color: #424242;
}

.file-upload-content small {
    color: #9e9e9e;
    font-size: 12px;
}

.excel-info-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #e8f5e9;
    border-radius: 8px;
    margin-bottom: 16px;
    border-left: 4px solid #4caf50;
}

.excel-info-box .material-icons {
    color: #4caf50;
    font-size: 24px;
}

.excel-info-box div {
    flex: 1;
}

.excel-info-box strong {
    display: block;
    font-size: 14px;
    color: #212121;
}

.excel-info-box span {
    font-size: 12px;
    color: #616161;
}

.excel-preview-container {
    max-height: 200px;
    overflow: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.excel-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.excel-preview-table th,
.excel-preview-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.excel-preview-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #D0021B;
    position: sticky;
    top: 0;
    z-index: 1;
}

.excel-preview-table td {
    font-family: 'Courier New', monospace;
    color: #424242;
}

.excel-preview-table tr:hover td {
    background: #fafafa;
}

.required {
    color: #D0021B;
}

/* Checkbox Styles */
.checkbox-group {
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #424242;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #D0021B;
}

/* Export Modal Styles */
.export-info-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #FFF8E1;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #FF9800;
}

.export-info-box .material-icons {
    color: #FF9800;
    font-size: 24px;
}

.export-format-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.radio-card {
    cursor: pointer;
}

.radio-card input[type="radio"] {
    display: none;
}

.radio-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.2s ease;
    background: #fafafa;
}

.radio-card-content .material-icons {
    font-size: 32px;
    color: #757575;
}

.radio-card-content span:not(.material-icons) {
    font-weight: 600;
    font-size: 14px;
    color: #424242;
}

.radio-card-content small {
    font-size: 11px;
    color: #9e9e9e;
}

.radio-card input[type="radio"]:checked + .radio-card-content {
    border-color: #D0021B;
    background: #FFF5F5;
}

.radio-card input[type="radio"]:checked + .radio-card-content .material-icons {
    color: #D0021B;
}

.radio-card:hover .radio-card-content {
    border-color: #bdbdbd;
    background: #f5f5f5;
}

.radio-card input[type="radio"]:checked:hover + .radio-card-content {
    border-color: #D0021B;
    background: #FFF5F5;
}

@media (max-width: 480px) {
    .export-format-options {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Basemap Switcher
   ======================================== */
.basemap-switcher {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 100;
}

.basemap-toggle {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.98);
    color: #424242;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.basemap-toggle:hover {
    background: #ffffff;
    color: #D0021B;
    transform: scale(1.05);
}

.basemap-toggle .material-icons {
    font-size: 24px;
}

.basemap-panel {
    display: none;
    position: absolute;
    bottom: 52px;
    left: 0;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 12px;
    min-width: 200px;
    backdrop-filter: blur(10px);
}

.basemap-panel.open {
    display: block;
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.basemap-panel-header {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #757575;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.basemap-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.basemap-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.basemap-option:hover {
    background: #f5f5f5;
}

.basemap-option.active {
    background: #FFF5F5;
}

.basemap-option input[type="radio"] {
    display: none;
}

.basemap-preview {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    background-size: cover;
    background-position: center;
    transition: border-color 0.2s ease;
}

.basemap-option.active .basemap-preview {
    border-color: #D0021B;
}

.osm-preview {
    background: linear-gradient(135deg, #f0e6d3 0%, #d4c4a8 50%, #e8dcc8 100%);
    position: relative;
}

.osm-preview::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #888;
}

.satellite-preview {
    background: linear-gradient(135deg, #1a3d1a 0%, #2d5a2d 30%, #1e4d1e 60%, #163316 100%);
}

.hybrid-preview {
    background: linear-gradient(135deg, #1a3d1a 0%, #2d5a2d 50%, #1e4d1e 100%);
    position: relative;
}

.hybrid-preview::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    background: rgba(255, 255, 0, 0.8);
}

.basemap-option span {
    font-size: 13px;
    font-weight: 500;
    color: #424242;
}

.basemap-option.active span {
    color: #D0021B;
}

/* ========================================
   Status Message
   ======================================== */
.status-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 13px;
    animation: slideInRight 0.3s ease;
    z-index: 3000;
}

.status-message.error {
    background: #ef4444;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ========================================
   OpenLayers Overrides
   ======================================== */
.ol-control {
    display: none;
}

.ol-attribution {
    display: none !important;
}

/* ========================================
   Mobile Menu Toggle
   ======================================== */
.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mobile-menu-toggle:hover {
    background: #FFE8E8;
    border-color: #D0021B;
}

.mobile-menu-toggle .material-icons {
    font-size: 24px;
    color: #D0021B;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.sidebar-close {
    display: none;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: #757575;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    align-items: center;
    justify-content: center;
}

.sidebar-close:hover {
    background: #f5f5f5;
    color: #D0021B;
}

.sidebar-close .material-icons {
    font-size: 20px;
}

/* ========================================
   Responsive - Tablet
   ======================================== */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }
    
    .geometry-item-name {
        font-size: 11px;
    }
    
    .geometry-item-type {
        font-size: 10px;
    }
}

/* ========================================
   Responsive - Mobile
   ======================================== */
@media (max-width: 768px) {
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
    }
    
    .sidebar-close {
        display: flex;
    }
    
    .container {
        flex-direction: column;
    }
    
    header {
        padding: 10px 15px;
    }
    
    header h1 {
        font-size: 16px;
    }
    
    header h1 svg,
    header h1 .header-logo {
        width: 28px;
        height: 28px;
    }
    
    .main-content {
        flex-direction: column;
        position: relative;
    }
    
    /* Sidebar - Slide-in from left */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        z-index: 2000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        border-right: 1px solid #e0e0e0;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-header {
        padding: 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .sidebar-header h2 {
        font-size: 14px;
    }
    
    .geometry-list {
        flex: 1;
        overflow-y: auto;
        max-height: calc(100vh - 140px);
    }
    
    .geometry-item {
        padding: 12px;
    }
    
    .geometry-item-actions button {
        padding: 8px;
    }
    
    .geometry-item-actions .material-icons {
        font-size: 18px;
    }
    
    .sidebar-footer {
        padding: 12px;
        border-top: 1px solid #e0e0e0;
        background: #fff;
    }
    
    .sidebar-footer .btn {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    /* Map - Full screen */
    #map {
        flex: 1;
        width: 100%;
        height: 100%;
    }
    
    /* Toolbar - Horizontal on mobile */
    .map-toolbar {
        top: 10px;
        right: 10px;
        left: auto;
        transform: none;
        flex-direction: row;
        padding: 6px;
        gap: 4px;
        border-radius: 8px;
    }
    
    .map-toolbar .btn {
        width: 36px;
        height: 36px;
    }
    
    .map-toolbar .material-icons {
        font-size: 20px;
    }
    
    /* Zoom info */
    .zoom-info {
        bottom: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .zoom-info .material-icons {
        font-size: 16px !important;
    }
    
    /* Modals - Full width */
    .modal {
        width: 95%;
        max-width: none;
        max-height: 85vh;
        margin: 10px;
    }
    
    .modal-lg {
        max-width: none;
    }
    
    .excel-preview-container {
        max-height: 150px;
    }
    
    .file-upload-area {
        padding: 30px 15px;
    }
    
    .file-upload-content .material-icons {
        font-size: 36px !important;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-footer {
        padding: 12px 15px;
    }
    
    .form-group label {
        font-size: 12px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px;
        font-size: 14px;
    }
    
    .style-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .color-input-wrapper input[type="color"] {
        width: 44px;
        height: 44px;
    }
    
    .projection-table {
        font-size: 11px;
    }
    
    .projection-table th,
    .projection-table td {
        padding: 10px 8px;
    }
    
    .projection-table .copy-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .btn {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .btn .material-icons {
        font-size: 18px;
    }
}

/* ========================================
   Responsive - Small Mobile
   ======================================== */
@media (max-width: 480px) {
    header h1 {
        font-size: 14px;
    }
    
    header h1 svg,
    header h1 .header-logo {
        width: 24px;
        height: 24px;
    }
    
    .sidebar {
        width: 90%;
        max-width: 300px;
    }
    
    .map-toolbar {
        top: 8px;
        right: 8px;
        left: auto;
        padding: 4px;
        gap: 2px;
    }
    
    .map-toolbar .btn {
        width: 34px;
        height: 34px;
    }
    
    .map-toolbar .material-icons {
        font-size: 18px;
    }
    
    .modal {
        width: 100%;
        max-height: 90vh;
        margin: 0;
        border-radius: 16px 16px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        animation: slideUp 0.3s ease;
    }
    
    @keyframes slideUp {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    .modal-header h2 {
        font-size: 15px;
    }
    
    .modal-header h2 .material-icons {
        font-size: 20px !important;
    }
    
    .style-group {
        padding: 12px;
    }
    
    .style-group label {
        font-size: 13px;
    }
}

/* ========================================
   Landscape Mode on Mobile
   ======================================== */
@media (max-width: 900px) and (orientation: landscape) {
    .sidebar {
        width: 300px;
        max-width: 40%;
    }
    
    .map-toolbar {
        flex-direction: column;
        top: 50%;
        left: auto;
        right: 10px;
        transform: translateY(-50%);
    }
}

/* ========================================
   Touch Device Optimizations
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .geometry-item-actions button {
        min-height: 40px;
        min-width: 40px;
    }
    
    .map-toolbar .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .modal-header button {
        min-height: 44px;
        min-width: 44px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        min-height: 44px;
    }
}
