/**
 * Advisor Guidance Widgets - CSS Styles
 */

/* Quote Slider Container */
.ag-quote-slider-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    position: relative;
    box-sizing: border-box;
    max-width: 100%;
    height: 400px; /* Set a fixed height for the container */
    overflow: hidden;
    z-index: 1; /* Ensure it's above other elements */
}

/* Quote Sections */
.ag-quote-section {
    height: 100%;
    flex: 1;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.ag-quote-section.active {
    flex: 6; /* Active section takes more space */
    z-index: 3;
}

/* Quote Tabs */
.ag-quote-tab {
    width: 100%;
    height: 100%;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 4;
}

.ag-quote-tab:hover {
    opacity: 0.9;
    transform: scale(1.02);
    filter: brightness(1.1);
}

.ag-quote-tab:active {
    transform: scale(0.98);
}

/* Tab title */
.ag-tab-title {
    color: #fff;
    margin: 0 0 20px 0;
    font-size: 28px;
    font-weight: 500;
    position: relative;
    z-index: 7;
    opacity: 0;
    transform: translateY(20px);
    animation: slideInDown 0.6s ease-out 0.1s forwards;
}

@keyframes slideInDown {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Quote Content */
.ag-quote-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 40px;
    color: #fff;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-30px);
    transition: opacity 0.5s ease-in-out, 
                visibility 0.5s ease-in-out,
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    z-index: 5;
}

.ag-quote-section.active .ag-quote-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    z-index: 6;
}

.ag-quote-section.active .ag-quote-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent);
    animation: shine 1.5s ease-in-out 0.3s;
}

@keyframes shine {
    to {
        left: 100%;
    }
}

/* SVG Watermark */
.ag-watermark {
    position: absolute;
    top: 0;
    right: 20%;
    bottom: 0;
    left: 0;
    background-image: url('/wp-content/uploads/2025/05/Accent White.svg');
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 700px auto;
    opacity: 0;
    z-index: 1;
    animation: fadeInScale 0.8s ease-out 0.2s forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 0.07;
        transform: scale(1);
    }
}

.ag-quote-text {
    font-size: 24px;
    line-height: 1.5;
    margin-bottom: 30px;
    font-style: italic;
    position: relative;
    z-index: 7;
    max-width: 70%;
    opacity: 0;
    transform: translateY(20px);
    animation: slideInDown 0.6s ease-out 0.3s forwards;
}

/* Removed accent line - was competing with design */

/* Quote wrapper and icon */
.ag-quote-wrapper {
    display: flex;
    align-items: flex-start;
    position: relative;
    z-index: 7;
}

.ag-quote-icon {
    flex: 0 0 100px;
    padding-right: 20px;
    margin-top: 0;
    opacity: 0;
    transform: rotate(-90deg) scale(0);
    animation: iconSpin 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.2s forwards;
}

@keyframes iconSpin {
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/* Navigation dots */
.ag-quote-navigation-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: none; /* Hidden by default on desktop */
    gap: 10px;
    z-index: 10;
}

.ag-quote-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.ag-quote-dot:hover {
    background-color: rgba(255, 255, 255, 0.7);
    transform: scale(1.15);
}

.ag-quote-dot.active {
    background-color: rgba(255, 255, 255, 1);
    transform: scale(1.2);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.ag-quote-dot.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

.ag-quote-author {
    font-size: 18px;
    font-weight: bold;
    position: relative;
    z-index: 7;
    opacity: 0;
    transform: translateY(20px);
    animation: slideInDown 0.6s ease-out 0.5s forwards;
}

/* Elementor Editor Specific Styles */
.elementor-editor-active .ag-quote-slider-container {
    min-height: 400px;
}

.elementor-editor-active .ag-quote-section {
    min-width: 60px;
}

.elementor-editor-active .ag-quote-section.active {
    min-width: 300px;
}

/* Desktop - Ensure proper styles above 1024px */
@media screen and (min-width: 1025px) {
    .ag-quote-slider-container {
        display: flex;
        flex-direction: row;
        height: 400px;
    }
    
    .ag-quote-section {
        display: block;
        position: relative;
        height: 100%;
    }
    
    .ag-quote-section.active {
        display: block;
    }
    
    .ag-quote-tab {
        display: flex;
    }
    
    .ag-quote-content {
        position: absolute;
        opacity: 0;
        visibility: hidden;
        padding: 30px 40px;
    }
    
    .ag-quote-section.active .ag-quote-content {
        opacity: 1;
        visibility: visible;
    }
    
    .ag-quote-navigation-dots {
        display: none;
    }
    
    .ag-tab-title {
        font-size: clamp(20px, 2vw, 28px);
    }
    
    .ag-quote-text {
        font-size: clamp(16px, 1.5vw, 24px);
        max-width: 85%;
    }
    
    .ag-quote-author {
        font-size: clamp(14px, 1.2vw, 18px);
    }
}

/* Larger desktop screens */
@media screen and (min-width: 1400px) {
    .ag-quote-slider-container {
        height: 450px;
    }
    
    .ag-quote-content {
        padding: 40px 60px;
    }
    
    .ag-quote-text {
        max-width: 75%;
    }
}

/* Responsive Adjustments - Tablets and Mobile */
@media screen and (max-width: 1024px) {
    .ag-quote-slider-container {
        height: auto;
        min-height: 350px;
        flex-direction: column;
        position: relative; /* Important for absolute positioning of dots */
    }
    
    /* Hide inactive sections on mobile */
    .ag-quote-section {
        display: none;
        flex: 1;
        height: 100%;
        min-height: 350px;
        position: static; /* Remove relative positioning */
    }
    
    /* Only show active section */
    .ag-quote-section.active {
        display: flex;
        flex: 1;
        height: 100%;
        position: static; /* Remove relative positioning */
    }
    
    /* Hide the tab bars on mobile */
    .ag-quote-tab {
        display: none;
    }
    
    /* Show content directly */
    .ag-quote-content {
        position: static; /* Change from relative to static */
        opacity: 1;
        visibility: visible;
        padding: 30px 20px 60px 20px; /* Extra bottom padding for dots */
        width: 100%;
        height: 100%;
        min-height: 350px;
    }
    
    .ag-tab-title {
        font-size: 22px;
        margin-bottom: 15px;
    }

    .ag-quote-text {
        font-size: 18px;
        margin-bottom: 20px;
        max-width: 100%;
    }
    
    .ag-quote-icon {
        flex: 0 0 60px;
        padding-right: 10px;
    }
    
    .ag-quote-icon svg {
        width: 50px;
        height: 50px;
    }

    .ag-quote-author {
        font-size: 16px;
    }
    
    .ag-watermark {
        background-size: 300px auto;
        right: -10%;
        top: 0;
    }
    
    /* Show navigation dots on mobile/tablet */
    .ag-quote-navigation-dots {
        display: flex; /* Show on mobile/tablet */
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        justify-content: center;
        z-index: 100;
    }
    
    .ag-quote-dot {
        width: 14px;
        height: 14px;
        background-color: rgba(255, 255, 255, 0.6);
        cursor: pointer;
        pointer-events: auto;
        transition: all 0.3s ease;
    }
    
    .ag-quote-dot:hover {
        background-color: rgba(255, 255, 255, 0.8);
        transform: scale(1.1);
    }
    
    .ag-quote-dot.active {
        background-color: rgba(255, 255, 255, 1);
        transform: scale(1.3);
    }
}

/* Extra small mobile devices */
@media screen and (max-width: 480px) {
    .ag-quote-slider-container {
        min-height: 400px;
    }
    
    .ag-quote-section {
        min-height: 400px;
        height: 100%;
    }
    
    .ag-quote-section.active {
        height: 100%;
    }
    
    .ag-quote-content {
        padding: 25px 15px 60px 15px; /* Extra bottom padding for dots */
        height: 100%;
        min-height: 400px;
    }
    
    .ag-tab-title {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .ag-quote-text {
        font-size: 16px;
        line-height: 1.6;
        margin-bottom: 15px;
    }
    
    .ag-quote-author {
        font-size: 14px;
    }
    
    .ag-watermark {
        background-size: 250px auto;
        top: 0;
    }
}

/* ==========================================================================
   YouTube Gallery Widget Styles
   ========================================================================== */

/* YouTube Playlist Widget Styles - inherits from gallery styles */
.ag-youtube-playlist {
    width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Playlist-specific grid layout */
.ag-youtube-playlist-grid .ag-youtube-videos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 0;
    margin: 0;
}

/* Playlist-specific list layout */
.ag-youtube-playlist-list .ag-youtube-videos {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ag-youtube-playlist-list .ag-youtube-video-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.ag-youtube-playlist-list .ag-youtube-video-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ag-youtube-playlist-list .ag-video-thumbnail {
    flex-shrink: 0;
    width: 200px;
}

.ag-youtube-playlist-list .ag-video-content {
    flex: 1;
}

/* Playlist-specific carousel layout */
.ag-youtube-playlist-carousel .ag-carousel-track {
    display: flex;
    transition: transform 0.3s ease;
    gap: 20px;
}

.ag-youtube-playlist-carousel .ag-youtube-video-item {
    flex: 0 0 calc(33.333% - 14px);
    min-width: 0;
}

/* Video Duration Overlay */
.ag-video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Courier New', monospace;
}

/* View Count Display */
.ag-video-views {
    font-size: 12px;
    color: #666;
    margin-left: 10px;
}

.ag-video-views::before {
    content: "👁 ";
    margin-right: 2px;
}

/* Enhanced Meta Section for Playlists */
.ag-youtube-playlist .ag-video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.ag-youtube-playlist .ag-video-meta > span {
    white-space: nowrap;
}

/* Responsive adjustments for playlist widget */
@media screen and (max-width: 768px) {
    .ag-youtube-playlist-grid .ag-youtube-videos {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .ag-youtube-playlist-list .ag-youtube-video-item {
        flex-direction: column;
        gap: 10px;
    }
    
    .ag-youtube-playlist-list .ag-video-thumbnail {
        width: 100%;
    }
    
    .ag-video-views {
        font-size: 11px;
    }
}

@media screen and (max-width: 480px) {
    .ag-youtube-playlist-grid .ag-youtube-videos {
        grid-template-columns: 1fr;
    }
    
    .ag-youtube-playlist .ag-video-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .ag-video-duration {
        font-size: 11px;
        padding: 1px 4px;
    }
}

/* Main Gallery Container */
.ag-youtube-gallery {
    width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Grid Layout */
.ag-youtube-gallery-grid .ag-youtube-videos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 0;
    margin: 0;
}

/* List Layout */
.ag-youtube-gallery-list .ag-youtube-videos {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ag-youtube-gallery-list .ag-youtube-video-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.ag-youtube-gallery-list .ag-youtube-video-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ag-youtube-gallery-list .ag-video-thumbnail {
    flex-shrink: 0;
    width: 200px;
}

.ag-youtube-gallery-list .ag-video-content {
    flex: 1;
}

/* Carousel Layout */
.ag-youtube-carousel-container {
    position: relative;
    overflow: hidden;
}

.ag-youtube-carousel {
    overflow: hidden;
    margin: 0 50px;
}

.ag-youtube-gallery-carousel .ag-carousel-track {
    display: flex;
    transition: transform 0.3s ease;
    gap: 20px;
}

.ag-youtube-gallery-carousel .ag-youtube-video-item {
    flex: 0 0 calc(33.333% - 14px);
    min-width: 0;
}

/* Carousel Navigation */
.ag-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 10;
}

.ag-carousel-nav:hover {
    background: rgba(0, 0, 0, 0.9);
}

.ag-carousel-prev {
    left: 10px;
}

.ag-carousel-next {
    right: 10px;
}

/* Carousel Dots */
.ag-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.ag-carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: #ccc;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.ag-carousel-dot.active,
.ag-carousel-dot:hover {
    background: #ff0000;
}

/* Video Item Styles */
.ag-youtube-video-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;
}

.ag-youtube-video-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Video Thumbnail */
.ag-video-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    background: #000;
}

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

.ag-youtube-video-item:hover .ag-video-thumbnail img {
    transform: scale(1.05);
}

/* Play Overlay */
.ag-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.8;
    transition: opacity 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

.ag-youtube-video-item:hover .ag-play-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.ag-play-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Video Content */
.ag-video-content {
    padding: 15px;
}

.ag-video-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
}

.ag-video-link {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ag-video-link:hover {
    color: #ff0000;
}

.ag-video-description {
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #666;
}

.ag-video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.ag-video-date {
    font-size: 12px;
    color: #888;
}

.ag-video-modal-trigger {
    background: #ff0000;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.ag-video-modal-trigger:hover {
    background: #cc0000;
}

/* Video Modal */
.ag-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ag-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.ag-modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.ag-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s ease;
}

.ag-modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

.ag-modal-video {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.ag-modal-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.ag-modal-title {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e1e5e9;
}

.ag-modal-title h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .ag-youtube-gallery-grid .ag-youtube-videos {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .ag-youtube-gallery-list .ag-youtube-video-item {
        flex-direction: column;
        gap: 10px;
    }
    
    .ag-youtube-gallery-list .ag-video-thumbnail {
        width: 100%;
    }
    
    .ag-youtube-gallery-carousel .ag-youtube-video-item {
        flex: 0 0 calc(50% - 10px);
    }
    
    .ag-youtube-carousel {
        margin: 0 40px;
    }
    
    .ag-carousel-nav {
        width: 35px;
        height: 35px;
    }
    
    .ag-modal-content {
        width: 95%;
        margin: 20px;
    }
}

@media screen and (max-width: 480px) {
    .ag-youtube-gallery-grid .ag-youtube-videos {
        grid-template-columns: 1fr;
    }
    
    .ag-youtube-gallery-carousel .ag-youtube-video-item {
        flex: 0 0 100%;
    }
    
    .ag-youtube-carousel {
        margin: 0 35px;
    }
    
    .ag-video-content {
        padding: 12px;
    }
    
    .ag-video-title {
        font-size: 14px;
    }
    
    .ag-video-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
} 