/* SkillCat Portfolio Page Styles */
#page-content {
  padding-bottom: 0 !important;
}

#page {
  margin: unset !important;
  border: unset !important;
  padding: unset !important;
}

.skillcat-portfolio {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #faf9f5;
    min-height: 100vh;
}

/* Empty State Styles */
.skillcat-portfolio.empty-state {
    background-color: #faf9f5;
}

.skillcat-portfolio.empty-state .portfolio-header {
    border-bottom: 1px solid #e6e6e6;
    /* Ensure proper centering and spacing when content area is empty */
    min-height: auto;
    display: flex;
    align-items: flex-start;
    padding-top: 24px;
}

/* Ensure the container centers properly in empty state */
.skillcat-portfolio.empty-state .container {
    width: 100%;
}

/* Hide any empty content sections that might still show */
.skillcat-portfolio.empty-state .portfolio-content {
    display: none;
}

/* Empty State Message Styling */
.portfolio-empty-state {
    padding: 152px 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.empty-state-message {
    width: 100%;
    text-align: center;
}

.empty-state-text {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 20px;
    font-weight: 500;
    color: #01023b;
    line-height: normal;
    margin: 0;
    width: 100%;
    text-align: center;
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 180px;
}

@media (max-width: 1440px) {
    .container {
        padding: 0 60px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
}

/* Header Section */
.portfolio-header {
    background-color: #faf9f5;
    padding: 24px 0;
    border-bottom: 1px solid #e6e6e6;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 40px;
    flex: 1;
}

.profile-image {
    width: 44px;
    height: 44px;
    border-radius: 44px;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-placeholder {
    width: 100%;
    height: 100%;
    background-color: #e6e6e6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 18px;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 20px;
    font-weight: 600;
    color: #01023b;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.contact-info {
    display: flex;
    gap: 32px;
    align-items: center;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: #2f384c;
}

.contact-item i {
    width: 14px;
    height: 14px;
    color: #2f384c;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
}

.btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 44px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-email {
    background-color: #f47d57;
    color: white;
}

.btn-email:hover {
    background-color: #e56b45;
    transform: translateY(-1px);
}

.btn-print {
    background-color: white;
    color: #2f384c;
    border: 1px solid #64748B !important;
}

.btn-print:hover {
    background-color: #f9fafb;
    transform: translateY(-1px);
}

.btn-email, .btn-print {
    border-radius: 44px !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.10);
}

/* Main Content */
.portfolio-content {
    padding: 32px 0;
}

/* Portfolio Sections */
.portfolio-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #01023b;
    margin: 0 0 20px 0;
    line-height: 1.2;
}

.section-divider {
    border: none;
    height: 1px;
    background-color: #e6e6e6;
    margin: 32px 0;
}

/* Courses Grid */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .courses-grid {
        grid-template-columns: 1fr;
    }
}

.course-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: white;
    border: 1px solid #e6e6e6 !important;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.course-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.course-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.course-icon img {
    font-size: 9px;
}

.badge-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.default-icon {
    width: 100%;
    height: 100%;
    background-color: #f47d57;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.course-info {
    flex: 1;
    min-width: 0;
}

.course-name {
    font-size: 16px;
    font-weight: 500;
    color: #01023b;
    margin: 0 0 4px 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.completion-date {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    line-height: 1.2;
}

/* Skills Container */
.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.skill-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    background: white;
    border: 1px solid #f2f2f2;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.skill-badge:hover {
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.skill-name {
    font-size: 16px;
    font-weight: 500;
    color: #01023b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Work Grid */
.work-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 16px;
}

@media (max-width: 1024px) {
    .work-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .work-grid {
        grid-template-columns: 1fr;
    }
}

.work-card {
    background: white;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.work-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.media-container {
    position: relative;
    width: 100%;
    height: 355px;
    overflow: hidden;
}

.media-display {
    width: 100%;
    height: 100%;
}

.work-image, .work-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.media-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 8px;
    pointer-events: none;
}

.nav-btn {
    width: 28px;
    height: 28px;
    background: rgba(0,0,0,0.24);
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: rgba(0,0,0,0.4);
    transform: scale(1.1);
}

.work-content {
    padding: 20px 24px;
}

.work-title {
    font-size: 16px;
    font-weight: 500;
    color: #01023b;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.work-description {
    font-size: 14px;
    color: #3e3f6a;
    margin: 0;
    line-height: 1.4;
}

/* See More/Less Buttons */
.see-more-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.btn-see-more {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
    background: none;
    border: none;
    color: #0b93fb;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-see-more:hover {
    color: #0873cc;
}

.btn-see-more i {
    transition: transform 0.3s ease;
}

.btn-see-more.expanded i {
    transform: rotate(180deg);
}

.hidden {
    display: none !important;
}

/* Media Modal */
.media-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.9);
    /* Prevent background scrolling on mobile */
    overflow: hidden;
}

/* Prevent body scrolling when modal is open */
body.modal-open {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
}

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

.modal-content {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: transparent;
    display: flex;
    flex-direction: column;
}

.modal-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1280px;
    max-width: 100vw;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 60px;
    z-index: 10001;
    box-sizing: border-box;
    /* Ensure header stays fixed on mobile */
    background: transparent;
}

.modal-header-spacer {
    width: 20px;
    height: 20px;
    border-radius: 30px;
}

.modal-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 171px;
    gap: 4px;
}

.counter-text {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 20px;
    font-weight: 500;
    color: white;
    line-height: 1;
    white-space: nowrap;
}

.modal-header-controls {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 20px;
    border-radius: 30px;
}

.modal-close {
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.modal-close:hover {
    opacity: 0.7;
}

.modal-media-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-media-display {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-media-display img,
.modal-media-display video {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

.modal-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 32px;
    pointer-events: none;
}

.modal-nav-btn {
    width: 44px;
    height: 44px;
    background: rgba(0,0,0,0.24);
    border: 1px solid white;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.2s ease;
    font-size: 16px;
}

.modal-nav-btn:hover {
    background: rgba(0,0,0,0.4);
    transform: scale(1.05);
}

.modal-nav-btn:disabled,
.modal-nav-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Print Styles */
@media print {
    .skillcat-portfolio {
        background: white !important;
    }
    
    .action-buttons {
        display: none !important;
    }
    
    .see-more-container {
        display: none !important;
    }
    
    .courses-grid,
    .work-grid {
        break-inside: avoid;
    }
    
    .course-card,
    .work-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .media-modal {
        display: none !important;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
    
    .portfolio-header {
        padding: 16px 0;
    }
    
    .header-content {
        flex-direction: row;
        gap: 12px;
        align-items: flex-start;
    }
    
    .user-info {
        flex: 1;
        gap: 12px;
    }
    
    .profile-image {
        width: 44px;
        height: 44px;
    }
    
    .user-details {
        flex: 1;
    }
    
    .user-name {
        font-size: 20px;
        margin: 0 0 8px 0;
    }
    
    .contact-info {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }
    
    .contact-item {
        font-size: 16px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 7px;
        flex-shrink: 0;
    }
    
    .btn {
        width: 36px;
        height: 36px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
        box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.1);
    }
    
    .btn span {
        display: none;
    }
    
    .btn i, .btn svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }
    
    /* Empty state mobile styling */
    .portfolio-empty-state {
        padding: 80px 20px;
    }
    
    .empty-state-text {
        font-size: 18px;
    }
    
    .btn-email {
        background-color: #f47d57;
        color: white;
        border: none;
    }
    
    .btn-print {
        background-color: white;
        color: #2f384c;
        border: 1px solid #6b7280;
    }
    
    .work-card .media-container {
        height: 250px;
    }
}

/* Tablet Responsive */
@media (max-width: 1024px) and (min-width: 769px) {
    .header-content {
        gap: 20px;
    }
    
    .user-info {
        gap: 20px;
    }
    
    .work-card .media-container {
        height: 300px;
    }
    
    /* Restore desktop button styles for tablets */
    .action-buttons {
        flex-direction: row;
        gap: 16px;
    }
    
    .btn {
        width: auto;
        height: auto;
        padding: 8px 16px;
        border-radius: 44px;
    }
    
    .btn span {
        display: inline;
    }
}

/* Desktop Responsive - Ensure buttons show properly on large screens */
@media (min-width: 1025px) {
    .action-buttons {
        flex-direction: row;
        gap: 16px;
    }
    
    .btn {
        width: auto;
        height: auto;
        padding: 8px 16px;
        border-radius: 44px;
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.10);
    }
    
    .btn span {
        display: inline;
    }
    
    .btn i, .btn svg {
        width: auto;
        height: auto;
    }
}

/* Navigation button states */
.nav-btn:disabled,
.modal-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-btn.disabled,
.modal-nav-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Enhanced modal styles */
.modal-media-display img {
    cursor: grab;
    user-select: none;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

.modal-media-display img:active {
    cursor: grabbing;
}

/* Loading state for media transitions */
.media-display img,
.media-display video {
    transition: opacity 0.2s ease;
}

.media-display img.loading,
.media-display video.loading {
    opacity: 0.7;
}

/* Ensure proper stacking of media items */
.media-display {
    position: relative;
}

.media-display img,
.media-display video {
    position: absolute;
    top: 0;
    left: 0;
}

/* Animation for see-more button icon */
.btn-see-more i {
    transition: transform 0.3s ease;
}

.btn-see-more.expanded i {
    transform: rotate(180deg);
}

/* Tooltip styles for skill names */
.tippy-box[data-theme~='skillcat-tooltip'] {
    background-color: #2f384c;
    color: white;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.tippy-box[data-theme~='skillcat-tooltip'] .tippy-arrow {
    color: #2f384c;
}

.tippy-box[data-theme~='skillcat-tooltip'] .tippy-content {
    padding: 0;
}

/* Touch-friendly navigation for mobile */
@media (max-width: 768px) {
    .modal-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100vw;
        transform: none;
        padding: 12px 20px;
        z-index: 10001;
        /* Add safe area padding for iOS devices */
        padding-top: max(12px, env(safe-area-inset-top));
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
    
    .modal-counter {
        width: auto;
    }
    
    .modal-close {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
    
    .modal-navigation {
        padding: 0 16px;
        /* Add safe area padding for bottom navigation */
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    
    .modal-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .nav-btn {
        width: 32px;
        height: 32px;
    }
    
    /* Ensure modal content area accounts for fixed header */
    .modal-media-container {
        padding-top: 60px;
        box-sizing: border-box;
    }
}

/* Enhanced responsive grid behavior */
@media (max-width: 480px) {
    .portfolio-header {
        padding: 12px 0;
    }
    
    .header-content {
        gap: 8px;
    }
    
    .user-info {
        gap: 8px;
    }
    
    .user-name {
        font-size: 18px;
        margin: 0 0 6px 0;
    }
    
    .contact-item {
        font-size: 14px;
    }
    
    .contact-item svg, 
    .contact-item i {
        width: 12px;
        height: 12px;
    }
    
    .action-buttons {
        gap: 6px;
    }
    
    .btn {
        width: 32px;
        height: 32px;
    }
    
    .btn i, .btn svg {
        width: 14px;
        height: 14px;
    }
    
    .courses-grid {
        gap: 12px;
    }
    
    .work-grid {
        gap: 16px;
    }
    
    .skills-container {
        gap: 8px;
    }
    
    .skill-badge {
        padding: 4px 12px;
    }
    
    .skill-name {
        font-size: 14px;
        max-width: 150px;
    }
}

/* Better handling of skill text overflow across devices */
@media (max-width: 768px) {
    .skill-name {
        max-width: 180px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .skill-name {
        max-width: 200px;
    }
}

/* Ensure smooth transitions during resize */
.courses-grid .course-card,
.work-grid .work-card,
.skills-container .skill-badge {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Loading state for dynamic calculations */
.skillcat-portfolio.calculating {
    pointer-events: none;
}

.skillcat-portfolio.calculating .portfolio-section {
    opacity: 0.7;
}

/* Hidden portfolio items (controlled by JavaScript) */
.portfolio-item-hidden {
    display: none !important;
}

/* Smooth transitions for portfolio items */
.course-card,
.skill-badge,
.work-card {
    transition: opacity 0.3s ease;
}