/**
 * Common Styles - Shared across all pages
 * Extracted from inline styles in HTML pages
 */

/* === RESET & BASE === */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body { 
    font-family: Arial, sans-serif; 
    background: #f9f9f9; 
    color: #333; 
}

/* === HEADER === */
header { 
    background: #fff; 
    border-bottom: 1px solid #ccc; 
    padding: 10px 20px; 
}

/* === MAIN LAYOUT === */
main { 
    max-width: 100vw; 
    margin: 20px auto; 
    padding: 0 20px; 
}

h1 { 
    font-size: 1.4rem; 
    margin-bottom: 15px; 
}

/* === STEPPER/TABS SYSTEM === */
.tabs-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tabs-nav {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid #ddd;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.tab-item {
    flex: 0 0 auto;
    min-width: 120px;
    padding: 12px 16px;
    background: #f8f9fa;
    border: none;
    border-right: 1px solid #ddd;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
}

.tab-item:last-child {
    border-right: none;
}

/* Tab states */
.tab-item.active {
    background: #007bff;
    color: white;
    font-weight: 600;
}

.tab-item.completed {
    background: #28a745;
    color: white;
}

.tab-item.completed:hover {
    background: #218838;
}

.tab-item.available {
    background: #fff;
    color: #007bff;
    border-bottom: 2px solid transparent;
}

.tab-item.available:hover {
    background: #e7f3ff;
    border-bottom: 2px solid #007bff;
}

.tab-item.locked {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Tab indicators */
.tab-item.completed::after {
    content: '✓';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 12px;
    font-weight: bold;
}

.tab-item.locked::after {
    content: '🔒';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 10px;
}

/* Scrollbar */
.tabs-nav::-webkit-scrollbar {
    height: 4px;
}

.tabs-nav::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.tabs-nav::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
}

/* === AIRTABLE SECTION === */
.airtable-section {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 0 0 4px 4px;
    border-top: none;
    padding: 15px;
    margin-bottom: 20px;
}

.airtable-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.airtable-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.airtable-btn {
    padding: 8px 16px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.airtable-btn:hover {
    background: #005dc1;
}

.airtable-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.airtable-status {
    margin-top: 10px;
    padding: 8px;
    border-radius: 4px;
    font-size: 14px;
}

/* === STATUS MESSAGES === */
.status-section {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 0 0 4px 4px;
    padding: 15px;
    margin-bottom: 20px;
    border-top: none;
}

.status-message {
    padding: 8px;
    border-radius: 4px;
    font-size: 14px;
}

.status-loading {
    background: #e7f3ff;
    color: #0066cc;
}

.status-success {
    background: #e8f5e8;
    color: #006600;
}

.status-error {
    background: #ffe6e6;
    color: #cc0000;
}

/* === MAP COMPONENTS === */
.map-lateral {
    display: flex;
    gap: 20px;
    align-items: stretch;
    height: 600px;
}

#map {
    flex: 1;
    min-height: 400px;
    background: #eee;
    position: relative;
}

.map-container {
    flex: 1;
    position: relative;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
}

aside.selected-parcels {
    width: 350px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 15px;
    overflow-y: auto;
}

aside.selected-parcels h2 {
    margin-bottom: 10px;
    font-size: 1rem;
}

#parcel-info {
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 15px;
}

#parcel-info div {
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
}

#total-area {
    font-weight: normal;
    margin-bottom: 15px;
    font-size: 16px;
}

/* === BUTTONS === */
button {
    display: inline-block;
    padding: 10px 15px;
    margin-bottom: 10px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: #007bff;
    color: #fff;
}

button:hover {
    background: #005dc1;
}

.btn-clear {
    background: #dc3545;
    margin-right: 10px;
}

.btn-clear:hover {
    background: #b52d38;
}

.btn-next-step {
    background: #28a745;
}

.btn-next-step:hover {
    background: #218838;
}

.btn-back {
    background: #6c757d;
    margin-right: 10px;
}

.btn-back:hover {
    background: #545b62;
}

/* === BASEMAP TOGGLE === */
#toggle-basemap {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
    border: 1px solid #ccc;
    color: #333;
    display: flex;
    align-items: center;
    gap: 5px;
}

#toggle-basemap:hover {
    background: #f0f0f0;
}

/* === BOTTOM CENTER === */
.bottom-center {
    text-align: center;
    margin-top: 15px;
    margin-bottom: 10px;
}

/* === RESPONSIVE === */
@media(max-width:768px){
    .map-lateral {
        flex-direction: column;
    }
    
    aside.selected-parcels {
        width: 100%;
    }
    
    .airtable-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tab-item {
        min-width: 100px;
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* === AIRTABLE SECTION === */
.airtable-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    border-top: none;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.airtable-section h3 {
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: 600;
}

.airtable-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.airtable-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.airtable-btn {
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.airtable-btn:hover {
    background: #0056b3;
}

.airtable-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.status-success { 
    background: #d4edda; 
    color: #155724; 
}

.status-error { 
    background: #f8d7da; 
    color: #721c24; 
}

.status-loading { 
    background: #d1ecf1; 
    color: #0c5460; 
}

.airtable-tip {
    margin-top: 10px;
    padding: 8px 12px;
    background: #e7f3ff;
    border-radius: 4px;
    font-size: 13px;
    color: #0066cc;
}


