/**
 * My Account Treatment Photos - Customer Frontend Styles
 *
 * Comprehensive styling for comparison, timeline, and grid views
 * with responsive design and modern aesthetics.
 *
 * @package eRide
 * @version 2.0.0
 */

/* ==========================================================================
   Layout & Container
   ========================================================================== */

.treatment-photos-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ==========================================================================
   Header Section
   ========================================================================== */

.photos-header {
    text-align: center;
    margin-bottom: 30px;
}

.photos-header h2 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #333;
}

.photos-description {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* ==========================================================================
   View Mode Toggle Buttons
   ========================================================================== */

.tp-view-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tp-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tp-view-btn:hover {
    border-color: #999;
    background: #f9f9f9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tp-view-btn.active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.tp-view-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   Comparison View
   ========================================================================== */

.tp-comparison-content {
    display: block;
}

.tp-comparison-card {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.tp-comparison-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.tp-angle-title {
    text-align: center;
    font-size: 22px;
    margin: 0 0 25px 0;
    color: #333;
    font-weight: 600;
}

.tp-comparison-pair {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    align-items: center;
    margin-bottom: 20px;
}

.tp-photo-slot {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tp-photo-slot img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.tp-photo-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 20px 15px 15px;
    color: #fff;
}

.tp-label-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.tp-label-tag.before-tag {
    background: #e74c3c;
}

.tp-label-tag.after-tag {
    background: #27ae60;
}

.tp-session-info,
.tp-date-info {
    display: block;
    font-size: 13px;
    margin-top: 4px;
}

/* Progress Arrow */
.tp-progress-arrow {
    text-align: center;
    min-width: 80px;
}

.tp-arrow-icon {
    display: block;
    font-size: 48px;
    color: #0073aa;
    margin-bottom: 10px;
    font-weight: 300;
}

.tp-progress-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tp-stat-sessions,
.tp-stat-duration {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

/* Zoom Button */
.tp-zoom-comparison {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.tp-zoom-comparison:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.tp-zoom-comparison .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Timeline View
   ========================================================================== */

.tp-timeline-content {
    display: none;
}

.tp-timeline {
    position: relative;
    padding-left: 50px;
}

.tp-timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e0e0e0;
}

.tp-timeline-item {
    position: relative;
    margin-bottom: 40px;
}

.tp-timeline-marker {
    position: absolute;
    left: -41px;
    top: 0;
    width: 42px;
    height: 42px;
    background: #0073aa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
    z-index: 2;
}

.tp-session-number {
    color: #fff;
    font-weight: 700;
    font-size: 16px;
}

.tp-timeline-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tp-timeline-card:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.tp-timeline-header {
    margin-bottom: 20px;
}

.tp-timeline-header h4 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: #333;
}

.tp-timeline-date {
    display: inline-block;
    font-size: 14px;
    color: #666;
    margin-right: 15px;
}

.tp-timeline-treatment {
    display: inline-block;
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 12px;
    color: #555;
    font-weight: 500;
}

.tp-session-photos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.tp-timeline-photo {
    position: relative;
}

.tp-timeline-photo-link {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease;
}

.tp-timeline-photo-link:hover {
    transform: scale(1.05);
}

.tp-timeline-photo img {
    width: 100%;
    height: auto;
    display: block;
}

.tp-photo-angle-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: capitalize;
}

/* ==========================================================================
   Grid View
   ========================================================================== */

.tp-grid-content {
    display: none;
}

.treatment-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.treatment-photo-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.treatment-photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.photo-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.photo-image-wrapper {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background: #f5f5f5;
}

.photo-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.treatment-photo-item:hover .photo-image-wrapper img {
    transform: scale(1.1);
}

.photo-info {
    padding: 15px;
}

.photo-treatment {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
}

.photo-details {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.photo-separator {
    margin: 0 6px;
}

.photo-session-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #0073aa;
    color: #fff;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

/* ==========================================================================
   Comparison Lightbox
   ========================================================================== */

.tp-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tp-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.tp-lightbox-content {
    position: relative;
    max-width: 1400px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    z-index: 2;
}

.tp-lightbox-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: #e74c3c;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 3;
}

.tp-lightbox-close:hover {
    background: #c0392b;
    transform: rotate(90deg);
}

.tp-lightbox-close .dashicons {
    color: #fff;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.tp-lightbox-header {
    text-align: center;
    margin-bottom: 30px;
}

.tp-lightbox-header h3 {
    margin: 0 0 10px 0;
    font-size: 26px;
    color: #333;
}

.tp-lightbox-header p {
    margin: 0;
    font-size: 16px;
    color: #666;
}

.tp-lightbox-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.tp-lightbox-photo {
    position: relative;
}

.tp-lightbox-photo img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tp-lightbox-label {
    margin-top: 15px;
    text-align: center;
}

.tp-lightbox-tag {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.tp-lightbox-label span {
    display: block;
    margin-top: 5px;
    font-size: 14px;
    color: #555;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Tablet */
@media (max-width: 992px) {
    .tp-comparison-pair {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .tp-progress-arrow {
        display: none;
    }

    .tp-lightbox-comparison {
        grid-template-columns: 1fr;
    }

    .tp-lightbox-content {
        padding: 30px 20px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .treatment-photos-wrapper {
        padding: 15px;
    }

    .photos-header h2 {
        font-size: 22px;
    }

    .tp-view-controls {
        gap: 10px;
    }

    .tp-view-btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .tp-comparison-card {
        padding: 20px;
    }

    .tp-angle-title {
        font-size: 18px;
    }

    .treatment-photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .tp-timeline {
        padding-left: 40px;
    }

    .tp-timeline::before {
        left: 15px;
    }

    .tp-timeline-marker {
        left: -35px;
        width: 35px;
        height: 35px;
    }

    .tp-session-number {
        font-size: 14px;
    }

    .tp-session-photos {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }

    .tp-lightbox-content {
        width: 95%;
        padding: 20px 15px;
    }

    .tp-lightbox-header h3 {
        font-size: 20px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .tp-view-btn {
        flex: 1 1 calc(50% - 10px);
        min-width: 140px;
        justify-content: center;
    }

    .treatment-photos-grid {
        grid-template-columns: 1fr;
    }

    .tp-comparison-card {
        padding: 15px;
    }
}

/* ==========================================================================
   Image Loading States
   ========================================================================== */

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.tp-view-btn:focus,
.tp-zoom-comparison:focus,
.tp-lightbox-close:focus {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tp-view-btn {
        border-width: 3px;
    }

    .tp-label-tag {
        font-weight: 900;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .tp-view-controls,
    .tp-zoom-comparison,
    .tp-lightbox {
        display: none !important;
    }

    .tp-comparison-content,
    .tp-timeline-content,
    .tp-grid-content {
        display: block !important;
    }

    .tp-comparison-card,
    .tp-timeline-card,
    .treatment-photo-item {
        page-break-inside: avoid;
    }
}
