/* --- Buttons --- */
.btn-upload, .login-btn, .hero-search-button, .btn-apply, .btn-upload-nav {
    background: var(--primary-gradient);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s;
    border-radius: var(--radius); 
}

/* Specific Button Sizes/Shapes */
.btn-upload, .login-btn { width: 100%; padding: 16px; font-size: 16px; margin-top: 10px; }
.btn-apply { padding: 12px 28px; border-radius: 25px; }

.btn-upload-nav { 
    padding: 12px 24px; 
    border-radius: 25px; 
    display: inline-block; 
    margin-bottom: 20px; 
    text-decoration: none; 
}
.btn-upload-nav:hover { transform: scale(1.05); text-decoration: none; color: white; }

.btn-clear, .toggle-filters-btn, .btn-page {
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-block;
}

.btn-clear { background: var(--danger); color: white; border: none; }
.btn-clear:hover { transform: scale(1.05); color: white; }

.toggle-filters-btn { 
    background: #ecf0f1; 
    border: 2px solid #bdc3c7; 
    color: var(--text-medium); 
    font-size: 14px;
    margin-top: 25px; 
    display: inline-block;
}
.toggle-filters-btn:hover { background: #bdc3c7; color: var(--secondary); }

.btn-page { background: white; border: 1px solid #ddd; color: var(--text-dark); padding: 8px 16px; margin: 0 5px; }
.btn-page:hover { background: #eee; text-decoration: none; }

/* --- Generic Action Buttons --- */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    color: white;
    transition: transform 0.2s, opacity 0.2s;
}

.btn:hover {
    transform: scale(1.05);
}

.btn-success {
    background-color: var(--success);
}

.btn-danger {
    background-color: var(--danger);
}


/* --- Cards --- */
.card, .model-card, .upload-form, .login-container, .filters-container, .model-detail {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.model-detail { padding: 30px; }
.upload-form { padding: 30px; border-radius: 12px; }


/* --- Forms & Inputs (GENERIC) --- */
input[type="text"], input[type="number"], input[type="url"], input[type="date"], input[type="password"],
select, textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 8px; color: var(--text-medium); }
.form-group small { display: block; color: var(--text-muted); font-size: 12px; margin-top: 5px; }
.form-group input[type="file"] {
    width: 100%; padding: 10px; border: 2px dashed var(--border-color);
    border-radius: var(--radius); background: #f9f9f9; cursor: pointer;
}


/* --- Tags --- */
.tag-badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
    background: var(--primary-gradient); color: white;
    border-radius: 20px; font-size: 14px; font-weight: 500;
}
.tag-badge.new-tag { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.tag-remove { cursor: pointer; font-weight: bold; opacity: 0.8; }
.tag-remove:hover { opacity: 1; }

.tags-suggestions {
    position: absolute; top: 100%; left: 0; right: 0;
    background: white; border: 2px solid var(--border-color);
    border-radius: 8px; max-height: 200px; overflow-y: auto;
    display: none; z-index: 1000; box-shadow: var(--shadow);
}
.tags-suggestions.show { display: block; }
.tag-suggestion { padding: 10px 15px; cursor: pointer; }
.tag-suggestion:hover { background: var(--bg-light); }
.tag-suggestion.create-new { color: var(--primary); font-weight: 600; border-top: 2px solid var(--border-color); }


/* --- Messages & Progress --- */
.message { margin-top: 20px; padding: 15px; border-radius: 8px; text-align: center; font-weight: 600; display: none; }
.message.success { background: var(--success-bg); color: #155724; border: 2px solid var(--success-border); }
.message.error, .error-msg { background: var(--danger-bg); color: #721c24; border: 2px solid var(--danger-border); }
.error-msg { margin-bottom: 20px; font-size: 14px; display: block; }

.progress-bar { width: 100%; height: 8px; background: var(--border-color); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary-gradient); width: 0%; transition: width 0.3s; }


/* --- Search Bar Component --- */
.hero-search-box {
    display: flex;
    align-items: stretch;
    box-shadow: var(--shadow);
    border-radius: 50px;
    overflow: hidden;
    background: white;
    border: 2px solid transparent;
    transition: box-shadow 0.2s, border-color 0.2s;
    width: 100%;
}

.hero-search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

input[type="text"].hero-search-input {
    flex: 1;
    padding: 16px 24px;
    border: none !important;
    border-radius: 0 !important;
    font-size: 16px;
    background: transparent;
    color: var(--text-dark);
    margin: 0;
}

input[type="text"].hero-search-input:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.hero-search-button {
    border-radius: 0;
    padding: 0 32px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Ratings --- */

/* Static Display */
.stars-static {
    color: #e0e0e0;
    font-size: 20px;
    margin-right: 5px;
}
.stars-static .filled {
    color: #f39c12;
}

/* Interactive Input */
.rating-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.star-rating-input {
    display: inline-flex;
    flex-direction: row-reverse;
    font-size: 24px;
}

.star-rating-input input { display: none; }

.star-rating-input label {
    cursor: pointer;
    color: #ddd;
    transition: color 0.2s;
    padding: 0 2px;
}

.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input input:checked ~ label {
    color: #f39c12;
}

/* Small Vote Button */
.btn-vote {
    padding: 6px 12px;
    font-size: 12px;
    background: #2c3e50;
    color: white;
    border-radius: 4px;
    margin-left: 10px;
}
.btn-vote:hover { background: #34495e; }

/* --- 3D Viewer --- */
#3d-container {
    width: 100%;
    height: 400px;
    background-color: #333;
    border-radius: 8px;
    display: none;         
    position: relative;     
    overflow: hidden;  
}

#loader-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(40, 40, 40, 0.95);
    color: #fff;
    padding: 20px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 10;
}

#loader-container div {
    color: #ddd !important;
}

.progress-track {
    width: 200px;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

#loader-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.2s ease;
}



/* --- Persistent Navbar --- */
body {
    padding-top: 70px; 
}

.top-navbar {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 70px;
    transition: transform 0.3s ease-in-out; 
}

.top-navbar.nav-hidden {
    transform: translateY(-100%); 
}

.nav-brand a {
    font-size: 24px;
    font-weight: 800;
    color: var(--secondary);
    text-decoration: none;
    margin-right: 40px;
}

.nav-groups {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 30px;
}

.nav-group {
    display: flex;
    align-items: center;
    gap: 15px;
    border-left: 2px solid var(--bg-light);
    padding-left: 20px;
}

.nav-right {
    margin-left: auto;
    border-left: none;
    border-right: 2px solid var(--bg-light);
    padding-right: 20px;
}

.nav-group-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: bold;
}

.nav-link {
    color: var(--text-dark);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary);
    text-decoration: none;
}

.nav-highlight {
    background: var(--primary-gradient);
    color: white !important;
    padding: 8px 16px;
    border-radius: 20px;
}

.nav-highlight:hover {
    transform: scale(1.05);
}

.nav-danger {
    color: var(--danger);
}

.nav-text {
    color: var(--text-medium);
}

.main-content {
    padding: 30px 0;
}

/* --- Mobile Navbar --- */

/* Hide toggle on desktop */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    margin-left: auto;
    color: var(--text-dark);
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: block; /* Show the hamburger button on mobile */
    }

    .nav-groups {
        display: none; 
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: white;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        padding: 10px 0;
        gap: 0;
    }

    .nav-groups.mobile-active {
        display: flex; 
    }

    .nav-group {
        border-left: none;
        border-bottom: 1px solid var(--bg-light);
        padding: 15px 20px;
        width: 100%;
        justify-content: flex-start;
    }

    .nav-right {
        margin-left: 0;
        border-right: none;
        padding-right: 20px;
    }
}

/* --- Upload Form Checkbox Panels --- */
.checkbox-panel {
    padding: 15px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.ai-panel {
    background: var(--bg-light);
}

.liability-panel {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label.align-top {
    align-items: flex-start;
}

.large-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.offset-checkbox {
    margin-top: 3px; 
}

.checkbox-hint {
    margin-left: 30px;
    display: block;
    margin-top: 5px;
}