/* Survey Page Specific Styles */
.survey-section {
    padding: 100px 0 100px;
    /* Reduced top padding, increased bottom for footer */
    min-height: 100vh;
}

.survey-container {
    max-width: 900px;
    margin: 0 auto;
}

.auth-card {
    max-width: 450px;
    margin: 100px auto;
    text-align: center;
}

.survey-card {
    background: var(--glass-surface);
    backdrop-filter: var(--glass-blur-md);
    -webkit-backdrop-filter: var(--glass-blur-md);
    border: 1px solid var(--glass-border);
    padding: 30px;
    border-radius: 24px;
    box-shadow: var(--shadow-glass);
    margin-bottom: 20px;
}

.item-row {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    margin-bottom: 24px;
    position: relative;
    transition: var(--transition-smooth);
    padding: 0;
    overflow: hidden;
}

.item-row:hover {
    border-color: rgba(224, 204, 167, 0.3);
}

.item-row.active {
    border-color: var(--gold-primary);
}

/* Override base .btn for portal context */
.btn {
    white-space: nowrap;
    min-width: fit-content;
    flex-shrink: 0;
}

.item-header {
    padding: 18px 24px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.item-row.collapsed .item-header {
    border-bottom-color: transparent;
}

.item-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.item-title-group {
    display: flex;
    flex-direction: column;
}

.item-summary {
    font-size: 0.95rem;
    color: var(--gold-primary);
    filter: brightness(1.2);
    margin-top: 6px;
    font-weight: 500;
}

.item-status-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #10b981;
    opacity: 0;
    transition: all 0.3s ease;
}

.item-status-icon.active {
    opacity: 1;
    transform: scale(1.1);
}

.item-body {
    padding: 20px 24px 24px;
    display: block;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.item-row.collapsed .item-body {
    max-height: 0;
    padding: 0 24px;
    opacity: 0;
    pointer-events: none;
}

.remove-item {
    background: rgba(239, 68, 68, 0.08);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}

.remove-item:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    width: 20px;
    text-align: center;
    opacity: 0.7;
}

.item-row.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

/* Media Grid */
.media-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.media-preview-item {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.media-preview-item img,
.media-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.media-preview-item:hover img,
.media-preview-item:hover video {
    transform: scale(1.1);
}

.delete-media {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 22px;
    height: 22px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    opacity: 0;
}

.media-preview-item:hover .delete-media {
    opacity: 1;
}

.upload-btn {
    background: rgba(224, 204, 167, 0.05);
    border: 1px dashed var(--gold-primary);
    color: var(--gold-primary);
    padding: 15px;
    border-radius: 12px;
    width: 100%;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 500;
}

.upload-btn:hover {
    background: rgba(224, 204, 167, 0.2);
}

.btn-discard {
    background: transparent !important;
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
    color: #ef4444 !important;
    transition: all 0.2s ease;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.btn-discard:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: #ef4444 !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

/* --- Input states --- */
input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 12px;
    color: white;
    width: 100%;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--gold-primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 12px rgba(224, 204, 167, 0.1);
    outline: none;
}

.item-qty {
    max-width: 80px;
    text-align: center;
}

.form-label,
label {
    font-size: 0.8rem;
    color: var(--text-gray);
    margin-bottom: 8px;
    display: block;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Header Discard Button */
.btn-outline-danger {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

.text-sm {
    font-size: 0.85rem;
    font-weight: 600;
}

/* --- Sticky Bottom Bar (Premium Floating Island) --- */
.form-actions {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 600px;
    background: rgba(20, 20, 25, 0.85);
    /* Deep dark glass */
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 100px;
    /* Stadium/Pill shape */
    padding: 8px;
    z-index: 9999;

    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    height: auto;
    /* Allow flexible height */
}

/* Button Reset */
.form-actions button {
    height: 54px;
    /* Taller, premium feel */
    border-radius: 100px !important;
    /* Full pill shape */
    margin: 0 !important;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

/* Back Button (Subtle/Ghost) */
#prevBtn {
    background: transparent;
    color: var(--text-gray);
    border: 1px solid transparent !important;
    flex: 0 0 100px;
    /* Fixed small width */
}

#prevBtn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

/* Next/Submit Button (Prominent/Gradient) */
#nextBtn,
#submitBtn {
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
    color: #000;
    border: none !important;
    flex: 1;
    /* Fills remaining space */
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

#nextBtn:hover,
#submitBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
    filter: brightness(1.1);
}

/* --- Requirement Item Row (Premium) --- */
.item-row {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    /* Smooth corners */
    margin-bottom: 1.2rem;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.item-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.item-header {
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: transparent;
}

.item-summary {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
    display: flex;
    align-items: center;
    width: 100%;
}

/* Hide Redundant Green Icon (Explicit) */
.item-status-icon {
    display: none !important;
}

.toggle-icon {
    font-size: 1rem;
    color: var(--text-gray);
    transition: transform 0.4s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    margin-left: 12px;
}

.item-row:not(.collapsed) .toggle-icon {
    transform: rotate(180deg);
    background: var(--gold-primary);
    color: #000;
}

/* Mobile Layout Override */
@media (max-width: 768px) {
    .survey-section {
        padding-bottom: 120px;
        /* More scroll space */
    }

    .form-actions {
        bottom: 20px;
        width: 90%;
        padding: 6px;
    }

    .form-actions button {
        height: 50px;
        font-size: 0.9rem;
    }
}

/* Hide Redundant Green Icon */
.item-status-icon {
    display: none !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 90%;
    max-width: 550px;
    background: var(--navy-darkest);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 0;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-overlay:not(.hidden) .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 24px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-gray);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 24px 30px;
    flex: 1;
    overflow-y: auto;
}

.modal-actions {
    padding-top: 24px;
    margin-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

@media (max-width: 480px) {
    .modal-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .modal-actions .btn {
        width: 100%;
        margin: 0;
    }
}

/* Steps Progress */
.survey-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.survey-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--glass-border);
    z-index: 1;
}

.step-indicator {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--navy-light);
    border: 2px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.step-indicator.active {
    background: var(--gold-primary);
    color: var(--navy-darkest);
    border-color: var(--gold-primary);
    box-shadow: var(--shadow-glow);
}

.step-indicator.completed {
    background: var(--gold-dark);
    color: white;
    border-color: var(--gold-dark);
}

.step-label {
    position: absolute;
    top: 50px;
    font-size: 0.8rem;
    white-space: nowrap;
    color: var(--text-gray);
}

/* FAB for Adding Items */
.fab-add-item {
    position: fixed;
    bottom: 110px;
    /* Above the footer */
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--gold-primary);
    color: var(--navy-darkest);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    cursor: pointer;
    z-index: 10000;
    /* Above footer */
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fab-add-item:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
}

@media (max-width: 768px) {
    .fab-add-item {
        bottom: 150px;
        /* Adjusted for mobile footer height */
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

/* Hide page actions when modal is open */
body.modal-open .form-actions,
body.modal-open .fab-add-item {
    display: none !important;
}

/* Header Buttons & Colored Outlines */
.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
    height: auto;
}

.btn-outline-success {
    background: rgba(16, 185, 129, 0.08);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2) !important;
}

.btn-outline-success:hover {
    background: #10b981;
    color: white;
    border-color: #10b981 !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-outline-danger {
    background: rgba(239, 68, 68, 0.08);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
}

.btn-outline-danger:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444 !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

@media (max-width: 480px) {
    .header-actions .text-sm {
        display: none;
    }
}