/* Dashboard Styles for Travorea */

/* Login Required Screen */
.login-required {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
}

.login-card {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    text-align: center;
    max-width: 450px;
    box-shadow: var(--shadow-soft);
}

.login-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.login-card h2 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.login-card > p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.login-card #google-signin-dashboard {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.login-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1.5rem;
}

/* Profile Header */
.profile-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem 0;
}

.profile-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
}

.profile-details h1 {
    color: white;
    margin-bottom: 0.25rem;
    font-size: 1.75rem;
}

.profile-email {
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.member-since {
    font-size: 0.85rem;
    opacity: 0.75;
}

.signout-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.signout-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Travel DNA Section */
.travel-dna-section {
    margin: 2rem 0;
}

.travel-dna-section h2 {
    margin-bottom: 1.5rem;
}

.travel-dna-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-soft);
}

.dna-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dna-item {
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 12px;
}

.dna-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.dna-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.dna-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: var(--primary-blue);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.tag.muted {
    background: var(--text-muted);
    opacity: 0.6;
}

.dna-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Recommendations */
.recommendations-section {
    margin-top: 2rem;
}

.recommendations-section h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.recommendations-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.recommendation-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.25rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.recommendation-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.rec-destination {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.rec-reason {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.btn-small {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

/* Empty States */
.dna-empty-state {
    text-align: center;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 12px;
}

.dna-empty-state p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Dashboard Tabs */
.dashboard-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 2rem 0 1rem;
    border-bottom: 2px solid var(--border-light);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-dark);
}

.tab-btn.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
}

.tab-icon {
    font-size: 1.1rem;
}

.tab-count {
    background: var(--bg-light);
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.tab-btn.active .tab-count {
    background: rgba(26, 95, 180, 0.1);
    color: var(--primary-blue);
}

/* Tab Content */
.tab-content {
    margin-bottom: 3rem;
}

.tab-pane {
    min-height: 300px;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-light);
    border-radius: 12px;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-card:hover {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-soft);
}

.history-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border-radius: 12px;
}

.history-info {
    flex: 1;
}

.history-info h4 {
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.history-meta {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.history-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.history-actions {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: var(--bg-light);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--border-light);
}

.delete-btn:hover {
    background: #fee;
}

/* Saved Places */
.saved-group {
    margin-bottom: 2rem;
}

.saved-group-title {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.place-count {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
}

.saved-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.saved-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.saved-card:hover {
    box-shadow: var(--shadow-hover);
}

.saved-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.saved-image-placeholder {
    width: 100%;
    height: 140px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.saved-info {
    padding: 1rem;
}

.saved-info h4 {
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.place-type {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.place-notes {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.4;
    margin-bottom: 0;
}

.saved-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.itinerary-modal-content {
    max-width: 900px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    line-height: 1.7;
}

.modal-body h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-blue);
}

.modal-body h2 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-body h3 {
    font-size: 1rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-blue);
}

.modal-body ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.modal-body li {
    margin-bottom: 0.35rem;
}

.modal-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.modal-body th,
.modal-body td {
    padding: 0.5rem;
    border: 1px solid var(--border-light);
    text-align: left;
}

.modal-body th {
    background: var(--bg-light);
    font-weight: 600;
}

.modal-body blockquote {
    background: linear-gradient(135deg, #fff8e1 0%, #fff3cd 100%);
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.modal-body blockquote p {
    margin: 0;
    color: #5d4e37;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-light);
}

/* Responsive */
@media (max-width: 768px) {
    .profile-header .container {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .profile-info {
        flex-direction: column;
    }

    .profile-avatar {
        width: 100px;
        height: 100px;
    }

    .dna-stats {
        gap: 1.5rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .dashboard-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .history-card {
        flex-wrap: wrap;
    }

    .history-info {
        width: 100%;
        order: 2;
    }

    .history-actions {
        order: 3;
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.5rem;
    }

    .modal-content {
        max-height: 95vh;
        border-radius: 12px;
    }

    .modal-actions {
        flex-wrap: wrap;
    }

    .modal-actions .btn {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem;
    }

    .travel-dna-card {
        padding: 1.5rem;
    }

    .dna-grid {
        grid-template-columns: 1fr;
    }

    .dna-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .saved-grid {
        grid-template-columns: 1fr;
    }

    .recommendations-list {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Saved Hotels Section
   ======================================== */
.hotels-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.saved-hotel-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s, box-shadow 0.3s;
}

.saved-hotel-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.saved-hotel-card .hotel-card-image {
    height: 160px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.saved-hotel-card .gps-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.saved-hotel-card .hotel-card-info {
    padding: 1rem;
}

.saved-hotel-card h4 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.saved-hotel-card .hotel-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.saved-hotel-card .hotel-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.saved-hotel-card .hotel-price span {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted);
}

.saved-hotel-card .hotel-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.saved-hotel-card .highlight-tag {
    background: var(--bg-light);
    color: var(--text-light);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.saved-hotel-card .hotel-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem 1rem;
    gap: 0.75rem;
}

.saved-hotel-card .hotel-card-actions .btn {
    flex: 1;
}

@media (max-width: 480px) {
    .hotels-list {
        grid-template-columns: 1fr;
    }
}
