/* Portfolio Page Styles */

/* Hero Section */
.portfolio-hero {
    min-height: 70vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.portfolio-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.05) 0%, rgba(124, 58, 237, 0.05) 100%);
    z-index: 1;
}

.portfolio-hero .container {
    position: relative;
    z-index: 2;
}

.breadcrumb ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hero-content h1 {
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.trust-indicators {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 2rem;
    margin: 2rem auto;
    border: 1px solid rgba(220, 38, 38, 0.1);
}

.stat-item {
    min-width: 120px;
}

/* Header Button Override - Ensure consistency with other pages */
header button[onclick="openAISensei()"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.5rem 1rem !important;
    border-radius: 9999px !important;
    background: none !important;
    position: relative !important;
    overflow: hidden !important;
    transform: none !important;
    min-width: auto !important;
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
    transition: all 0.3s ease !important;
}

header button[onclick="openAISensei()"]:hover {
    transform: scale(1.05) !important;
    box-shadow: none !important;
}

@media (min-width: 1024px) {
    header button[onclick="openAISensei()"] {
        padding: 0.75rem 2rem !important;
        font-size: 1rem !important;
        line-height: 1.5rem !important;
    }
}

/* CTA Buttons */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.5;
    min-width: 200px;
}

.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(220, 38, 38, 0.3);
}

/* Featured Success Stories */
.featured-stories {
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
}

.success-story-card {
    background: white;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(220, 38, 38, 0.1);
}

.success-story-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.story-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.success-story-card:hover .story-image img {
    transform: scale(1.05);
}

.transformation-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: linear-gradient(135deg, #dc2626, #7c3aed);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.story-content {
    padding: 2rem;
}

.story-content h3 {
    color: #1f2937;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.career-transformation {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.career-transformation .before {
    color: #dc2626;
    font-weight: 600;
}

.career-transformation .after {
    color: #059669;
    font-weight: 600;
}

.quote {
    color: #374151;
    font-style: italic;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    position: relative;
    padding-left: 1.5rem;
}

.quote::before {
    content: '"';
    position: absolute;
    left: 0;
    top: -0.5rem;
    font-size: 3rem;
    color: #dc2626;
    opacity: 0.3;
}

.achievements {
    list-style: none;
    padding: 0;
    margin: 0;
}

.achievements li {
    color: #059669;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.achievements li::before {
    content: '✓';
    color: #059669;
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Course Navigation Tabs */
.course-tabs {
    margin-bottom: 3rem;
}

.course-tab {
    background: white;
    border: 2px solid #e5e7eb;
    color: #6b7280;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem;
}

.course-tab:hover {
    border-color: #dc2626;
    color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

.course-tab.active {
    background: linear-gradient(135deg, #dc2626, #7c3aed);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.course-tab i {
    font-size: 1rem;
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.portfolio-card {
    background: white;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(220, 38, 38, 0.1);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.portfolio-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.portfolio-card:nth-child(1) { animation-delay: 0.1s; }
.portfolio-card:nth-child(2) { animation-delay: 0.2s; }
.portfolio-card:nth-child(3) { animation-delay: 0.3s; }
.portfolio-card:nth-child(4) { animation-delay: 0.4s; }
.portfolio-card:nth-child(5) { animation-delay: 0.5s; }
.portfolio-card:nth-child(6) { animation-delay: 0.6s; }

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

.portfolio-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-card:hover .portfolio-image img {
    transform: scale(1.05);
}

.featured-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #dc2626, #7c3aed);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.course-badge {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.portfolio-content {
    padding: 1.5rem;
}

.portfolio-content h3 {
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.student-info {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.student-info i {
    color: #dc2626;
}

.portfolio-description {
    color: #374151;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.portfolio-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.view-portfolio-btn {
    background: linear-gradient(135deg, #dc2626, #7c3aed);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.view-portfolio-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.3);
    color: white;
}

.testimonial-preview {
    background: #f8fafc;
    border-left: 3px solid #dc2626;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.testimonial-text {
    color: #374151;
    font-size: 0.875rem;
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.testimonial-career {
    color: #059669;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Testimonials Carousel */
.testimonials-carousel {
    max-width: 1000px;
    margin: 0 auto;
}

.testimonials-wrapper {
    position: relative;
}

.testimonials-track {
    display: flex;
    gap: 2rem;
}

.testimonial-slide {
    min-width: 100%;
    background: white;
    border-radius: 1.5rem;
    padding: 3rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.1);
}

.testimonial-quote {
    font-size: 1.25rem;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 2rem;
    font-style: italic;
}

.testimonial-author {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.testimonial-role {
    color: #6b7280;
    font-size: 1rem;
}

.carousel-btn {
    width: 50px;
    height: 50px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.carousel-btn:hover {
    background: #f3f4f6 !important;
    transform: scale(1.1);
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: #d1d5db;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicators button.active {
    background: #dc2626;
    transform: scale(1.2);
}

/* Get Inspired Section */
.get-inspired {
    position: relative;
    overflow: hidden;
}

.get-inspired::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.2) 100%);
    z-index: 1;
}

.get-inspired .container {
    position: relative;
    z-index: 2;
}

.success-formula {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.formula-step {
    text-align: center;
}

.step-icon {
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* Loading States */
.portfolio-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    flex-direction: column;
    gap: 1rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #dc2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty States */
.portfolio-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}

.portfolio-empty i {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .portfolio-hero {
        min-height: 60vh;
        padding: 2rem 0;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .trust-indicators {
        padding: 1.5rem;
        margin: 1.5rem auto;
    }
    
    .trust-indicators .flex {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .course-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 1rem;
        margin-bottom: 2rem;
    }
    
    .course-tab {
        flex-shrink: 0;
        margin-right: 0.5rem;
    }
    
    .testimonial-slide {
        padding: 2rem 1.5rem;
    }
    
    .testimonial-quote {
        font-size: 1.125rem;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
    }
    
    .carousel-prev {
        left: 1rem !important;
    }
    
    .carousel-next {
        right: 1rem !important;
    }
    
    .success-formula {
        padding: 1.5rem;
    }
    
    .formula-step {
        margin-bottom: 2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .portfolio-card {
        border-radius: 1rem;
    }
    
    .portfolio-content {
        padding: 1.25rem;
    }
    
    .testimonial-slide {
        padding: 1.5rem 1rem;
    }
    
    .success-story-card {
        border-radius: 1rem;
    }
    
    .story-content {
        padding: 1.5rem;
    }
}

/* ==================================
   8. IMAGE LOADING & OPTIMIZATION
   ================================== */

.portfolio-image,
.story-image {
    position: relative;
    overflow: hidden;
    background: #f8f9fa; /* Fallback background */
}

.portfolio-image img,
.story-image img {
    transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
    opacity: 1; /* Ensure images are always visible */
    filter: none;
}

.portfolio-image img.loaded,
.story-image img.loaded {
    opacity: 1;
    filter: none;
}

.portfolio-image img.error-fallback,
.story-image img.error-fallback {
    opacity: 0.8;
    filter: grayscale(20%);
}

/* Image loading fallback */
img {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

/* Ensure testimonial images are circular and load properly */
.rounded-full {
    border-radius: 50%;
    background: #f3f4f6;
}

/* WhatsApp Button Icon Color Fix */
#floating-whatsapp button {
    color: white !important;
    background-color: rgb(34, 197, 94) !important; /* bg-green-500 */
    border: none !important;
    min-width: auto !important;
}

#floating-whatsapp button:hover {
    background-color: rgb(22, 163, 74) !important; /* bg-green-600 */
}

#floating-whatsapp button svg {
    fill: currentColor !important;
    color: white !important;
}

/* WhatsApp Button Status Indicator Fix */
#floating-whatsapp .absolute.-top-1 {
    background-color: rgb(74, 222, 128) !important; /* bg-green-400 */
}

/* WhatsApp Button Ping Animation Fix */
#floating-whatsapp .animate-ping {
    background-color: rgb(74, 222, 128) !important; /* bg-green-400 */
}

.image-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #dc2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Lazy loading placeholder styles */
.portfolio-image::before,
.story-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    z-index: 1;
}

.portfolio-image img.loaded + ::before,
.story-image img.loaded + ::before {
    display: none;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* WebP support styles */
.webp .portfolio-image img,
.webp .story-image img {
    background-image: none;
}

/* ==================================
   9. RESPONSIVE IMAGES
   ================================== */

@media (max-width: 768px) {
    .portfolio-image,
    .story-image {
        height: 200px;
    }
    
    .loading-spinner {
        width: 20px;
        height: 20px;
    }
}