@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,500;1,300&display=swap');

/* --------------------------------------------- Upload Files Section */

/* Upload container - center on screen */
.upload-files .upload-container {
    display: flex;
    justify-content: center; /* Center the entire upload section */
    align-items: stretch; /* Align items vertically */
    width: 100%;
    max-width: 1200px;
    margin: 0 auto; /* Center horizontally */
    gap: 20px; /* Space between boxes */
}



/* Upload boxes (Left: JSON, Right: XLSX) */
 .upload-box {
    flex: 1;
    background: #3a3a3c; 
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 450px;
    color: white;
    position: relative;
}

.upload-box h2 {
    margin-bottom: 12px; /* or whatever spacing you want */
  }
  

.upload-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  
.upload-files .upload-box input {
    display: block;
    margin: 0 auto;
    color: white;
}


/* Upload buttons */
.upload-files .upload-box button.upload-btn {
    background-color: #39b54a;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 0px;
}


.upload-files .upload-box button:hover {
    background-color: #39b54a;
}

/* Error messages */
.upload-files .error-message {
    color: #ff4c4c;
    font-size: 14px;
    margin-top: 5px;
}

/* 🔹 General file-preview container (shared styles) */
.upload-files .file-preview {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    border: 1px solid #777;
    background: #2b2b2d;
    height: 200px;
    text-align: left;
    font-size: 14px;
    white-space: pre-wrap;
    color: #ddd;
}

/* 🔹 Left Side (JSON Preview) - Entire box should scroll */
.json-preview {
    overflow-y: auto; /* ✅ The entire box can scroll */
    overflow-x: hidden;
}

/* 🔹 Right Side (XLSX Preview) - No scrolling, only inside */
.xlsx-preview {
    display: flex;
    flex-direction: column;
    height: 200px; /* ✅ Fixed height */
    overflow: hidden; /* ✅ Prevents full preview from scrolling */
}
/* ✅ Default message inside file preview box */
/* ✅ Default message inside BOTH file preview boxes */
.file-preview .no-file-message {
    text-align: center;
    font-size: 16px;
    color: #bbb;
    padding-top: 80px; /* ✅ Centers the text vertically */
}



/* --------------------------------------------- Table Section */
/* Table Section */

.table-wrapper {
    display: flex;
    flex-direction: column;
    height: 200px; /* ✅ Must match .file-preview */
    background: white;
}

/* Table styles */
.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
}

.table-wrapper th, .table-wrapper td {
    padding: 0px;
    text-align: left;
    border: 1px solid #ddd;
}

/* Table header styling */
.table-wrapper th {
    background: #3a3a3c;
    color: white;
}

/* Table container to prevent overflow */
/* 🔹 Table inside XLSX Preview - Only this should scroll */
#xlsxTableContainer {
    flex-grow: 1; /* ✅ Ensures it fills available space */
    max-height: 160px; /* ✅ Fixes table height */
    overflow-y: auto; /* ✅ Only table content scrolls */
}

/* --------------------------------------------- Sheet Tabs */

/* 🔹 Keep Sheet Tabs fixed at the bottom */
.sheet-tabs {
    height: 40px; /* ✅ Locks height */
    display: flex;
    justify-content: flex-start;
    background: white; /* ✅ Match table header */
    color: black;
}


/* Individual tab styling */
.sheet-tab {
    background: white;
    color: black; /* ✅ Black text for all tabs */
    font-weight: normal; /* ✅ Default weight for unselected tabs */
    font-size: 12px; /* ✅ Smaller font */
    flex-grow: 1; /* ✅ Ensures tabs fit evenly */
    text-align: center;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: background 0.2s ease;
}

/* Active tab styling */
.sheet-tab.active {
    font-weight: bold; /* ✅ Bold font for selected tab */
}


/* Tab hover effect */
.sheet-tab:hover {
    background: #bbb;
}

/* --------------------------------------------- Navigation Bar */
.upload-files .nav-bar {
    width: 100%;
    text-align: center;
    margin-top: 20px;
}

.upload-files .nav-bar button {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    font-size: 18px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.upload-files .nav-bar button:disabled {
    background-color: #b0b0b0;
    cursor: not-allowed;
}

.upload-files .nav-bar button:hover:enabled {
    background-color: #0056b3;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
  }
  
  .modal-content {
    background-color: white;
    width: 200px;
    height: 200px;
    padding: 0.5rem;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; /* ⬅️ Center messages horizontally */
    text-align: center;   /* ⬅️ Align message text center */
    font-size: 0.9rem;
    line-height: 1.4;
  }
  
  .modal-content p {
    margin: 2px 0;
    padding: 0;
  }
  
  #savedMapsModal .modal-content {
    width: 400px !important;
    height: auto !important;
    padding: 20px;
    border-radius: 10px;
    background-color: white;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }
  
  
  .select-saved-btn:hover {
    background-color: #e0e0e0;
  }
  
  .upload-header {
    text-align: center;
    margin-bottom: 12px;
  }
  
  .select-saved-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    font-size: 13px;
    font-family: sans-serif;
    background-color: #3a3a3c;
    color: #575759;
    border: 1px solid #575759;
    border-radius: 5px;
    cursor: pointer;
  }
  
  .upload-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
  }
  
  .saved-maps-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 20px 0;
    width: 100%;
    max-height: 120px;
    overflow-y: auto;
    text-align: left;
  }
  
  .saved-maps-list li {
    background-color: #f5f5f5;
    color: #333;
    padding: 8px 12px;
    border: 1px solid #ccc;
    margin-bottom: 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
  }
  
  .saved-maps-list li:hover {
    background-color: #e0e0e0;
  }
  
  .template-btn {
    background-color: #39b54a;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
  }
  
  .template-btn:hover {
    background-color: #2fa640;
  }
    

/* --------------------------------------------- Responsive Styles */
@media (max-width: 768px) {
    .upload-files .upload-container {
        flex-direction: column;
        align-items: center;
    }

    .upload-files .upload-box {
        width: 90%;
    }
}
