/* ===================================================
   File: dashboard.css
   Description: Styles specific to the client dashboard.
   =================================================== */

/* General Dashboard Layout */
.dashboard-main {
    padding-top: 100px;
    padding-bottom: 60px;
    background-color: #080824;
    min-height: 100vh;
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Sidebar Styles */
.dashboard-sidebar {
    width: 280px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 25px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
}

.user-profile {
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.user-profile img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--accent-cyan);
    margin-bottom: 15px;
    object-fit: cover;
}

.user-profile h3 {
    font-size: 1.3rem;
    color: var(--primary-text);
}

.user-profile p {
    font-size: 0.9rem;
    color: var(--secondary-text);
    word-break: break-all;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--secondary-text);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background-color: rgba(51, 213, 229, 0.1);
    color: var(--accent-cyan);
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
}

/* Content Styles */
.dashboard-content {
    flex-grow: 1;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
    min-width: 0; /* <-- This line has been added to fix the flexbox expansion issue */
}

.content-section {
    display: none;
}
.content-section.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.content-section h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--accent-pink);
    padding-bottom: 10px;
    display: inline-block;
}

/* Project Tracker Timeline */
.tracker-timeline {
    position: relative;
    padding-left: 40px;
}
.tracker-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--border-color);
}
.timeline-item {
    position: relative;
    margin-bottom: 40px;
}
.timeline-item:last-child {
    margin-bottom: 0;
}
.timeline-icon {
    position: absolute;
    left: -32px;
    top: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--dark-blue);
    border: 3px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--secondary-text);
    font-size: 0.8rem;
    transition: all 0.3s ease;
}
.timeline-item.completed .timeline-icon {
    border-color: var(--accent-cyan);
    background: var(--accent-cyan);
    color: var(--dark-blue);
}
.timeline-item.active .timeline-icon {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
    transform: scale(1.2);
}
.timeline-content h3 {
    margin-bottom: 5px;
}
.timeline-content small {
    color: var(--secondary-text);
    display: block;
    margin-bottom: 10px;
}
.progress-bar {
    height: 8px;
    background: var(--dark-blue);
    border-radius: 5px;
    margin-top: 10px;
    overflow: hidden;
}
.progress-bar div {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-pink), var(--accent-cyan));
    border-radius: 5px;
}

/* Documents Hub Styles */
.document-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}
.document-item {
    background: var(--dark-blue);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.document-item .icon {
    font-size: 3rem;
    color: var(--accent-cyan);
    margin-bottom: 15px;
}
.document-item h4 {
    margin-bottom: 10px;
}
.document-item .btn {
    margin-top: auto;
    padding: 8px 18px;
    font-size: 0.9rem;
}

/* Messages / Chat Styles */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 60vh;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}
.message-list {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.message-item {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 15px;
    margin-bottom: 10px;
    line-height: 1.4;
}
.message-item.sent {
    background: var(--accent-cyan);
    color: var(--dark-blue);
    border-bottom-right-radius: 3px;
    align-self: flex-end;
}
.message-item.received {
    background: var(--dark-blue);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 3px;
    align-self: flex-start;
}
.message-input-form {
    display: flex;
    padding: 10px;
    background: var(--dark-blue);
    border-top: 1px solid var(--border-color);
}
#message-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--primary-text);
    padding: 0 10px;
    outline: none;
    font-size: 1rem;
}
.message-input-form .btn {
    padding: 10px 15px;
}

/* Inspiration Board Styles */
.inspiration-upload {
    margin-bottom: 30px;
}
.inspiration-upload #upload-status {
    margin-left: 15px;
    color: var(--secondary-text);
}
.inspiration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}
.inspiration-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}
.inspiration-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Profile Settings Form Styles */
#profile-update-form .form-group, #password-update-form .form-group {
    margin-bottom: 20px;
}
#profile-update-form label, #password-update-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}
#profile-update-form input[type="text"], #password-update-form input[type="password"],
#profile-update-form input[type="file"] {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    background: var(--dark-blue);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--primary-text);
    font-family: 'Poppins', sans-serif;
}
.form-divider {
    margin: 30px 0;
    border-color: var(--border-color);
}

/* Saved Estimates Card */
.estimate-card {
    background: var(--dark-blue);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-bottom: 15px;
}
.estimate-card h4 {
    color: var(--accent-cyan);
}
.estimate-cost {
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 10px;
}

/* --- NEW STYLES ADDED BELOW --- */

/* Task Checklist Styles */
.task-list {
    list-style: none;
    padding-left: 20px;
    margin-top: 15px;
}

.task-item {
    margin-bottom: 8px;
    color: var(--secondary-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.task-item.completed {
    color: var(--primary-text);
    text-decoration: line-through;
}

.task-item i {
    color: var(--accent-cyan);
}

.task-item.completed i {
    color: #2ecc71; /* Green color for completed tasks */
}

/* Daily Progress Log Styles */
.daily-log-card {
    background: var(--dark-blue);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.daily-log-card h4 {
    color: var(--accent-cyan);
    margin-bottom: 5px;
}

.daily-log-card small {
    display: block;
    color: var(--secondary-text);
    margin-bottom: 15px;
}

.log-image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.log-image-gallery img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

/* Gantt Chart Styles */
#gantt-chart-container .gantt .bar-wrapper.active .bar {
    fill: var(--accent-pink);
}

#gantt-chart-container .gantt .bar-progress {
    fill: var(--accent-cyan);
}

/* --- FIX FOR GANTT CHART RESPONSIVENESS --- */

#gantt-chart-container {
    overflow-x: auto; /* Add horizontal scrollbar if chart is too wide */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */
    padding-bottom: 15px; /* Space for the scrollbar */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--dark-blue);
}

#gantt-chart-container .gantt .grid-background {
    fill: transparent; /* Make background transparent */
}

#gantt-chart-container .gantt .grid-header,
#gantt-chart-container .gantt .grid-row {
    fill: var(--dark-blue); /* Match header/row background */
}

#gantt-chart-container .gantt .lower-text,
#gantt-chart-container .gantt .upper-text {
    fill: var(--secondary-text); /* Change date text color */
    font-weight: 500;
}

#gantt-chart-container .gantt .row-line {
    stroke: var(--border-color); /* Change row separator line color */
}

#gantt-chart-container .gantt .tick {
     stroke: var(--border-color); /* Change vertical grid line color */
}

#gantt-chart-container .gantt .task-name {
    fill: var(--primary-text); /* Change task name text color */
}

#gantt-chart-container .gantt .bar-label {
    fill: var(--dark-blue); /* Text color on top of the bar */
    font-weight: 600;
}

/* Scrollbar styling for better look */
#gantt-chart-container::-webkit-scrollbar {
    height: 8px;
}

#gantt-chart-container::-webkit-scrollbar-track {
    background: var(--dark-blue);
}

#gantt-chart-container::-webkit-scrollbar-thumb {
    background-color: var(--accent-cyan);
    border-radius: 10px;
    border: 2px solid var(--dark-blue);
}

/* dashboard.css (Append) */
.document-category {
    margin-bottom: 30px;
}
.document-category h3 {
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}
.document-item small {
    color: var(--secondary-text);
    margin-bottom: 10px;
    display: block;
}

/* --- NEW STYLES for My Collections --- */

.collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.collection-card {
    background-color: var(--dark-blue);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: var(--primary-text);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.collection-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(51, 213, 229, 0.15);
}

.collection-card-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.collection-card-info {
    padding: 15px;
}

.collection-card-info h4 {
    margin: 0 0 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collection-card-info p {
    font-size: 0.9rem;
    color: var(--secondary-text);
    margin: 0;
}

/* ===================================================
   DASHBOARD INTEGRATION FEATURES CSS
   =================================================== */

/* --- My Wishlist --- */
.wishlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Reusing .product-card style from store.css would be ideal, 
   but for separation, we can define a simplified version here. */
.wishlist-item-card {
    background: var(--dark-blue);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.wishlist-item-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.wishlist-item-details {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.wishlist-item-details h4 {
    margin-bottom: 5px;
    font-size: 1.1rem;
    flex-grow: 1;
}
.wishlist-item-price {
    color: var(--accent-cyan);
    font-weight: 600;
    margin-bottom: 15px;
}
.wishlist-item-actions {
    display: flex;
    gap: 10px;
}
.wishlist-item-actions .btn {
    flex: 1;
    padding: 8px 10px;
    font-size: 0.9rem;
}

/* --- Order History --- */
.order-card {
    background: var(--dark-blue);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}
.order-header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 15px;
}
.order-header-info span {
    display: block;
    color: var(--secondary-text);
    font-size: 0.9rem;
}
.order-header-info strong {
    color: var(--primary-text);
}
.order-status {
    padding: 6px 12px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
}
.order-status.processing { background-color: #fef3c7; color: #d97706; }
.order-status.shipped { background-color: #dbeafe; color: #1d4ed8; }
.order-status.delivered { background-color: #d1fae5; color: #059669; }

.order-item-list {
    margin-top: 10px;
}
.order-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
}
.order-item:not(:last-child) {
    border-bottom: 1px solid #080824; /* Darker border */
}
.order-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}
.order-item-details {
    flex-grow: 1;
}
.order-item-details a {
    color: var(--primary-text);
    text-decoration: none;
    font-weight: 500;
}
.order-item-details p {
    font-size: 0.9rem;
    color: var(--secondary-text);
}

/* ===================================================
   ADVANCED ORDER TRACKING CSS
   =================================================== */
.order-header .track-order-btn {
    padding: 6px 15px;
    font-size: 0.85rem;
    align-self: center; /* Align with other items */
}

.tracking-modal-container {
    max-width: 800px;
    width: 90%;
}
.tracking-modal-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.tracking-modal-header h3 {
    margin-bottom: 5px;
    font-size: 1.8rem;
}
.tracking-modal-header p {
    color: var(--secondary-text);
}

.tracking-timeline-container {
    padding: 40px 20px;
}
.tracking-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
}
.tracking-timeline::before { /* The connecting line */
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 4px;
    background: var(--border-color);
}
.tracking-timeline::after { /* The progress line */
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    width: 0;
    height: 4px;
    background: var(--accent-cyan);
    transition: width 0.5s ease-in-out;
}
.tracking-timeline.progress-50::after { width: 50%; }
.tracking-timeline.progress-75::after { width: 75%; }
.tracking-timeline.progress-100::after { width: 100%; }
/* Add more classes for different progress levels */
.tracking-timeline.progress-25::after { width: 25%; }


.tracking-step {
    text-align: center;
    position: relative;
    width: 20%;
}
.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--dark-blue);
    border: 3px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 10px;
    color: var(--secondary-text);
    transition: all 0.4s ease;
}
.step-label {
    font-size: 0.9rem;
    color: var(--secondary-text);
}
.step-date {
    font-size: 0.8rem;
    color: var(--secondary-text);
    margin-top: 5px;
}

/* Step States */
.tracking-step.completed .step-icon {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: var(--dark-blue);
}
.tracking-step.completed .step-label {
    color: var(--primary-text);
}
.tracking-step.active .step-icon {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
    transform: scale(1.2);
}
.tracking-step.active .step-label {
    color: var(--accent-pink);
    font-weight: 600;
}

.delivery-estimate {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* ===================================================
   LOYALTY & REWARDS PROGRAM CSS
   =================================================== */
.rewards-overview {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    align-items: center;
    margin-bottom: 40px;
    background: var(--dark-blue);
    padding: 20px;
    border-radius: 10px;
}
.points-card {
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-cyan));
    color: var(--dark-blue);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
}
.points-card p {
    color: var(--dark-blue);
    font-weight: 500;
    margin: 0;
}
.points-card h3 {
    font-size: 4rem;
    margin: 10px 0;
    line-height: 1;
}
.rewards-info h4 {
    margin-bottom: 15px;
}
.rewards-info ul {
    list-style: none;
}
.rewards-info ul li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--secondary-text);
}
.rewards-info ul i {
    color: var(--accent-cyan);
    width: 20px;
}
.rewards-history-container {
    /* Basic table styling can be reused */
}
.rewards-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.rewards-history-table th, .rewards-history-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}
.rewards-history-table th {
    color: var(--accent-cyan);
}
.points-credit { color: #2ecc71; }
.points-debit { color: #e74c3c; }

@media (max-width: 768px) {
    .rewards-overview {
        grid-template-columns: 1fr;
    }
}

/* --- World Class Order Card Styles --- */
.order-card {
    background: var(--dark-blue);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.order-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 15px;
}

.order-header-info span {
    font-size: 0.8rem;
    color: var(--secondary-text);
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-header-info strong {
    color: #fff;
    font-size: 0.95rem;
}

.order-body {
    padding: 20px;
}

.order-product {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.order-product img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.product-info h4 {
    color: var(--primary-text);
    margin-bottom: 5px;
}

.product-info p {
    color: var(--secondary-text);
    font-size: 0.9rem;
}

.order-footer {
    padding: 15px 20px;
    background: rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- Dynamic Tracking Bar --- */
.tracking-bar {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    position: relative;
}

.tracking-bar::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #333;
    z-index: 0;
}

.track-step {
    position: relative;
    z-index: 1;
    text-align: center;
    width: 25%;
}

.track-dot {
    width: 30px;
    height: 30px;
    background: #333;
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: 3px solid var(--dark-blue);
}

.track-step.active .track-dot {
    background: var(--accent-cyan);
    color: #000;
}

.track-step.completed .track-dot {
    background: #2ecc71;
    color: #fff;
}

.track-label {
    font-size: 0.8rem;
    color: var(--secondary-text);
}

.track-step.active .track-label {
    color: var(--accent-cyan);
    font-weight: bold;
}

/* --- Address Grid Styles --- */
.address-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.address-card {
    background: var(--dark-blue);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 10px;
    position: relative;
}

.address-type {
    background: rgba(51, 213, 229, 0.1);
    color: var(--accent-cyan);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.delete-addr-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
}