/* Bottom Tabs Component CSS */

/* Typography */
.survey-with-bottom-tabs {
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App version styling */
.app-version {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.text-primary {
  color: var(--primary-color) !important; 
}

.bg-primary {
  background-color: var(--primary-color) !important;
}

/* Form Controls */
.form-control {
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 10px 14px;
    font-size: 16px;
    transition: var(--transition);
    background-color: var(--card-background);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(23, 111, 117, 0.1);
    background-color: var(--card-background);
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Cards and Content
WHY ARE WE SETTING THESE IN BOTTOM_TABS.CSS???
.content-card {
    background: var(--card-background);
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.content-card:hover {
    box-shadow: var(--shadow-medium);
}
*/

/* Page Headers */
.page-header {
    background: white;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 12px 0;
    margin-bottom: 20px;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    display: none; /* Remove the texture overlay */
}

.page-header h2 {
    position: relative;
    z-index: 1;
    color: var(--primary-color);
    font-weight: bold;
}

.page-header p {
    position: relative;
    z-index: 1;
    color: var(--primary-color);
    opacity: 0.8;
}

/* Bottom Tab Bar */
.bottom-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-background);
    border-top: 1px solid var(--border-color);
    box-shadow: var(--shadow-strong);
    z-index: 1000;
    height: calc(88px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
}

.tab-container {
    display: flex;
    height: 100%;
    /*align-items: center;*/
    padding: 0 8px;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    padding: 14px 8px;
    margin: 0;
    border-radius: 0;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    border: none;
    outline: none;
    cursor: pointer;
    background: var(--card-background);
    font-size: 14px;
    font-weight: 600;
    transition: none;
    transform: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    border-right: 1px solid var(--border-color);
}

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

.tab-item:hover {
    color: var(--primary-color);
    text-decoration: none;
    background-color: var(--primary-light);
    transform: none;
}

.tab-item:active {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.tab-item.active {
    color: var(--primary-color);
    background-color: var(--primary-light);
    border-bottom: 3px solid var(--primary-color);
    border-radius: 0; /* selected tab stays square-cornered */
}

.tab-item.active::before {
    display: none;
}

.tab-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    transition: none;
    transform: none;
}

.tab-item:hover .tab-icon {
    transform: none;
}

.tab-item.active .tab-icon {
    transform: none;
}

.tab-label {
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.2px;
}

/* Content sections */
.content-section {
    display: none;
}

.content-section.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* List Groups */
.list-group-item {
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    background-color: transparent;
    transition: var(--transition);
}

.list-group-item:hover {
    background-color: var(--primary-light);
}

.list-group-item:last-child {
    border-bottom: none;
}

/* Badges */
.badge {
    font-weight: 600;
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.status-uploaded { 
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)) !important; 
    color: white !important;
}

.status-edited {
    background: linear-gradient(135deg, #6f42c1, #5936a3) !important;
    color: white !important;
}

.status-draft {
    background: linear-gradient(135deg, var(--warning-color), #e67e22) !important; 
    color: white !important;
}

/* Responsive Design */
@media (max-width: 600px) {

    .bottom-tabs {
        height: calc(76px + env(safe-area-inset-bottom));
    }

    .tab-item {
        padding: 12px 6px;
    }

    .tab-label {
        font-size: 11px;
    }

    .tab-icon {
        width: 22px;
        height: 22px;
    }

    .page-header {
        padding: 8px 0;
        margin-bottom: 16px;
        border-radius: 5px;
    }

    .app-version {
        font-size: 0.8rem;
    }
    
    .form-label {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .form-control {
        padding: 8px 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .btn-primary {
        padding: 10px 20px;
        font-size: 16px;
    }
    
    .main-content {
        padding: 3px 0;
    }
    
    .list-group-item {
        padding: 6px 8px;
    }
    
    .list-group-item h6 {
        font-size: 0.95rem;
    }
    
    .list-group-item .text-muted {
        font-size: 0.8rem;
    }
    
    .badge {
        font-size: 10px;
        padding: 4px 8px;
    }
}

@media (max-width: 390px) {
  .page-header {
        padding: 6px 0;
        border-radius: 4px;
    }
    .app-version {
        font-size: 0.75rem;
    }
}

/* Mobile landscape: flatten bottom tabs to save vertical space */
@media (orientation: landscape) and (max-height: 500px) {
    .survey-with-bottom-tabs {
        padding-bottom: calc(56px + env(safe-area-inset-bottom));
        overflow: hidden;
    }

    .bottom-tabs {
        height: calc(56px + env(safe-area-inset-bottom));
    }

    .tab-item {
        padding: 6px 8px;
        flex-direction: row;
        gap: 6px;
    }

    .tab-icon {
        width: 24px;
        height: 24px;
        margin-bottom: 0;
    }

    .tab-label {
        font-size: 13px;
    }
}
