/* =============== MODERN USER PANEL STYLESHEET =============== */
:root {
    --primary-color: #0d3a5f;
    --primary-hover: #07253f;
    --accent-orange: #ff9800;
    --accent-orange-hover: #e68900;
    --accent-green: #10b981;
    --accent-green-bg: #ecfdf5;
    --accent-red: #ef4444;
    --accent-red-bg: #fef2f2;
    --neutral-dark: #1e293b;
    --neutral-muted: #64748b;
    --neutral-light: #f8fafc;
    --border-color: #e2e8f0;
    --card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 8px -1px rgba(0, 0, 0, 0.03);
    --hover-shadow: 0 10px 25px -5px rgba(13, 58, 95, 0.1), 0 8px 16px -6px rgba(13, 58, 95, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: #f1f5f9 !important;
    color: var(--neutral-dark);
}

/* Container Spacing */
.container.mt-4.mb-4 {
    margin-top: 2rem !important;
    margin-bottom: 2rem !important;
}

/* Card wrappers */
.personal-tool, .screen-tool {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    height: auto;
    transition: var(--transition);
}

.screen-tool {
    padding: 0;
    min-height: 500px;
}

.dashboard-overview {
    padding: 24px;
}

/* Title bars */
.title-main {
    background-color: var(--primary-color) !important;
    padding: 16px 24px;
    color: #ffffff;
    font-weight: 600;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 0.5px;
}

/* --- Profile Sidebar --- */
.personal-tool .name {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 18px;
    text-align: center;
    margin-top: 12px;
    margin-bottom: 6px;
}

/* Verification Badge */
.verification-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 9999px;
    margin: 4px auto 12px auto;
    cursor: pointer;
    transition: var(--transition);
}

.verification-badge.unverified {
    background-color: #fff7ed;
    color: #c2410c;
    border: 1px solid #ffedd5;
}

.verification-badge.unverified:hover {
    background-color: #ffedd5;
    transform: translateY(-1px);
}

.verification-badge.verified {
    background-color: var(--accent-green-bg);
    color: var(--accent-green);
    border: 1px solid #d1fae5;
    cursor: default;
}

.verification-badge i {
    font-size: 10px;
}

.boost-count-text {
    font-size: 13px;
    color: var(--neutral-muted);
    text-align: center;
    margin-bottom: 20px;
}

.boost-count-text span {
    color: var(--accent-orange);
    font-size: 15px;
}

/* Navigation lists */
.personal-tool .title {
    background-color: var(--neutral-light);
    color: var(--neutral-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 24px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.personal-tool .function {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.personal-tool .function li {
    padding: 0;
    border: none;
}

.personal-tool .function a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--neutral-muted);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.personal-tool .function a i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    transition: var(--transition);
}

.personal-tool .function a:hover {
    background-color: var(--neutral-light);
    color: var(--primary-color);
    border-left-color: var(--accent-orange);
}

.personal-tool .function a:hover i {
    color: var(--accent-orange);
    transform: scale(1.1);
}

.personal-tool .function li.active a {
    background-color: #f0f6fa;
    color: var(--primary-color);
    font-weight: 600;
    border-left-color: var(--primary-color);
}

.personal-tool .function li.active a i {
    color: var(--primary-color);
}

/* Avatar Update Section */
.avatar-update {
    position: relative;
    max-width: 140px;
    margin: 24px auto 16px auto;
}

.avatar-update .avatar-preview {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    transition: var(--transition);
}

.avatar-update:hover .avatar-preview {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.avatar-update .avatar-edit {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: var(--transition);
    z-index: 2;
    cursor: pointer;
}

.avatar-update:hover .avatar-edit {
    opacity: 1;
}

.avatar-update .avatar-edit input {
    display: none;
}

.avatar-update .avatar-edit label {
    color: #ffffff;
    cursor: pointer;
    font-size: 20px;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.avatar-update .avatar-edit label span {
    font-size: 11px;
    font-weight: 500;
}

#imgPreview {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E%3Cdefs%3E%3ClinearGradient id='bgGrad' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%23f0f4f8'/%3E%3Cstop offset='100%25' stop-color='%23d9e2ec'/%3E%3C/linearGradient%3E%3ClinearGradient id='userGrad' x1='0%25' y1='0%25' x2='0%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%23bcccdc'/%3E%3Cstop offset='100%25' stop-color='%23829ab1'/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx='64' cy='64' r='64' fill='url(%23bgGrad)'/%3E%3Ccircle cx='64' cy='50' r='20' fill='url(%23userGrad)'/%3E%3Cpath d='M28 104c0-17.7 14.3-32 32-32h8c17.7 0 32 14.3 32 32z' fill='url(%23userGrad)'/%3E%3C/svg%3E");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    width: 100%;
    height: 100%;
}

/* --- Dashboard Overview Cards --- */
.dashboard-title-desc {
    color: var(--neutral-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--neutral-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow);
    border-color: #cbd5e1;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
}

.stat-card.blue .stat-icon {
    background: #e0f2fe;
    color: #0284c7;
}

.stat-card.green .stat-icon {
    background: #dcfce7;
    color: #16a34a;
}

.stat-card.orange .stat-icon {
    background: #ffedd5;
    color: #ea580c;
}

.stat-card.purple .stat-icon {
    background: #f3e8ff;
    color: #9333ea;
}

.stat-card .stat-info {
    display: flex;
    flex-direction: column;
}

.stat-card .stat-info .value {
    font-size: 24px;
    font-weight: 700;
    color: var(--neutral-dark);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-info .label {
    font-size: 12px;
    font-weight: 500;
    color: var(--neutral-muted);
}

/* --- Form Fields Premium Redesign --- */
.form-info {
    padding: 30px 24px !important;
}

.form-label {
    font-weight: 600;
    color: var(--neutral-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.form-control {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--neutral-dark);
    background-color: #f8fafc;
    transition: var(--transition);
}

.form-control:focus {
    background-color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(13, 58, 95, 0.1);
    outline: 0;
}

.btn-primary-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e5a8f 100%);
    color: #ffffff;
    border: none;
    padding: 12px 32px;
    font-weight: 600;
    border-radius: 10px;
    transition: var(--transition);
}

.btn-primary-gradient:hover {
    background: linear-gradient(135deg, #124d7d 0%, var(--primary-color) 100%);
    box-shadow: var(--hover-shadow);
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-danger-gradient {
    background: linear-gradient(135deg, var(--accent-red) 0%, #dc2626 100%);
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-danger-gradient:hover {
    background: linear-gradient(135deg, #b91c1c 0%, var(--accent-red) 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
    color: #ffffff;
}

/* --- Listings Management View --- */
.listings-table-container {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table {
    margin-bottom: 0;
    vertical-align: middle;
}

.table thead {
    background-color: var(--neutral-light);
}

.table thead th {
    font-weight: 600;
    font-size: 12px;
    color: var(--neutral-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

.table tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.table .listing-img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.table .listing-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--neutral-dark);
    margin-bottom: 4px;
    line-height: 1.4;
}

.table .listing-meta {
    font-size: 12px;
    color: var(--neutral-muted);
    display: flex;
    gap: 12px;
    margin-bottom: 0;
}

.table .listing-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.table .listing-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table .action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--neutral-muted);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.table .action-btn:hover {
    background: var(--neutral-light);
    color: var(--primary-color);
    border-color: #cbd5e1;
}

.table .action-btn.edit:hover {
    color: var(--primary-color);
    background: #e0f2fe;
    border-color: #bae6fd;
}

.table .action-btn.refresh:hover {
    color: var(--accent-orange);
    background: #ffedd5;
    border-color: #fed7aa;
}

.table .action-btn.delete:hover {
    color: var(--accent-red);
    background: var(--accent-red-bg);
    border-color: #fecaca;
}

/* iOS Toggle Switch */
.ios-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-switch {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 34px;
}

.slider-switch:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ios-switch input:checked + .slider-switch {
    background-color: var(--accent-green);
}

.ios-switch input:focus + .slider-switch {
    box-shadow: 0 0 1px var(--accent-green);
}

.ios-switch input:checked + .slider-switch:before {
    transform: translateX(20px);
}

/* --- Drag & Drop Zone --- */
.dropzone-area {
    border: 2px dashed #cbd5e1;
    background-color: var(--neutral-light);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.dropzone-area:hover, .dropzone-area.dragover {
    border-color: var(--primary-color);
    background-color: #f0f6fa;
}

.dropzone-area .dropzone-icon {
    font-size: 32px;
    color: var(--neutral-muted);
    margin-bottom: 12px;
    transition: var(--transition);
}

.dropzone-area:hover .dropzone-icon {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.dropzone-area p {
    margin: 0;
    font-size: 13px;
    color: var(--neutral-muted);
}

.dropzone-area p strong {
    color: var(--primary-color);
}

.dropzone-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

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

.thumbnail-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.thumbnail-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: rgba(239, 68, 68, 0.9);
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 11px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0.8;
}

.thumbnail-preview-item:hover .remove-btn {
    opacity: 1;
    transform: scale(1.1);
}

/* --- Sectioned Cards Layout for Forms --- */
.form-section-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
}

.form-section-card .section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.form-section-card .section-title i {
    font-size: 18px;
}

/* --- Toast Notifications --- */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.custom-toast {
    background: #ffffff;
    color: var(--neutral-dark);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary-color);
    padding: 16px 20px;
    width: 320px;
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transition: var(--transition);
}

.custom-toast.hide {
    animation: toastFadeOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.custom-toast.success {
    border-left-color: var(--accent-green);
}

.custom-toast.error {
    border-left-color: var(--accent-red);
}

.custom-toast.info {
    border-left-color: var(--primary-color);
}

.custom-toast.warning {
    border-left-color: var(--accent-orange);
}

.custom-toast .toast-icon {
    font-size: 18px;
    margin-top: 2px;
}

.custom-toast.success .toast-icon { color: var(--accent-green); }
.custom-toast.error .toast-icon { color: var(--accent-red); }
.custom-toast.info .toast-icon { color: var(--primary-color); }
.custom-toast.warning .toast-icon { color: var(--accent-orange); }

.custom-toast .toast-content {
    flex-grow: 1;
}

.custom-toast .toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.custom-toast .toast-desc {
    font-size: 12px;
    color: var(--neutral-muted);
}

.custom-toast .toast-close {
    color: var(--neutral-muted);
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    transition: var(--transition);
}

.custom-toast .toast-close:hover {
    color: var(--neutral-dark);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastFadeOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-20px);
        opacity: 0;
    }
}

/* --- Verification Modal & General Modal Blurs --- */
.modal-backdrop.show {
    backdrop-filter: blur(4px);
    background-color: rgba(15, 23, 42, 0.4);
}

.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.modal-header {
    background-color: var(--neutral-light);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
}

.modal-title {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    background-color: var(--neutral-light);
    padding: 16px 24px;
}

/* Info card for modal description */
.verify-info-box {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
    color: #1e3a8a;
    font-size: 13px;
    display: flex;
    gap: 12px;
}

.verify-info-box i {
    font-size: 18px;
    color: #3b82f6;
    margin-top: 2px;
}

.verify-info-box ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

/* Responsive Table Fixes */
@media (max-width: 768px) {
    .stat-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .table thead {
        display: none;
    }
    
    .table tbody tr {
        display: block;
        border-bottom: 2px solid var(--border-color);
        padding: 12px 0;
    }
    
    .table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 16px;
        border: none;
        text-align: right;
    }
    
    .table tbody td:first-child {
        justify-content: center;
    }
    
    .table tbody td:before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--neutral-muted);
        float: left;
        text-align: left;
        font-size: 12px;
        text-transform: uppercase;
    }
    
    .table .listing-img {
        width: 100%;
        height: 150px;
    }
    
    .table .listing-meta {
        justify-content: flex-end;
    }
    
    /* Profile Sidebar Mobile Grid Navigation */
    .personal-tool {
        margin-bottom: 24px !important;
    }
    
    .personal-tool .function {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        padding: 12px !important;
    }
    
    .personal-tool .function li {
        width: 100% !important;
    }
    
    /* Make logout (or single odd item at the end) span full width */
    .personal-tool .function li:last-child:nth-child(odd) {
        grid-column: span 2 !important;
    }

    .personal-tool .function a {
        border-left: none !important;
        border-radius: 8px !important;
        background-color: var(--neutral-light) !important;
        padding: 10px 14px !important;
        font-size: 13px !important;
        font-weight: 500 !important;
        justify-content: flex-start !important;
        gap: 8px !important;
        border: 1px solid var(--border-color) !important;
        height: 100% !important;
        box-sizing: border-box !important;
    }

    .personal-tool .function li.active a {
        background-color: #f0f6fa !important;
        border-color: var(--primary-color) !important;
        color: var(--primary-color) !important;
    }
    
    .personal-tool .title {
        padding: 8px 16px !important;
        font-size: 10px !important;
        text-align: left !important;
    }
    
    /* Responsive Form Action Buttons */
    .form-info .d-flex {
        flex-direction: column-reverse !important;
        gap: 12px !important;
        width: 100% !important;
    }
    .form-info .d-flex a,
    .form-info .d-flex button {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
        margin: 0 !important;
    }
}
