/* Portfolio Frontend Styles - WordPress Compatible Version with Theme Isolation */

/* Theme isolation wrapper */
.pm-portfolio-wrapper {
    isolation: isolate !important;
    contain: layout style !important;
    position: relative !important;
}

/* Scoped reset and styles for portfolio container only */
.pm-portfolio-wrapper .portfolio-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    background-color: #F5F0E8 !important;
    color: #0a0a0a !important;
    line-height: 1.6 !important;
    position: relative !important;
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 40px 60px;
    z-index: 1;
    border-radius: 0;
    box-shadow: none;
    min-height: 100vh;
}

/* Apply box-sizing only to portfolio elements */
.pm-portfolio-wrapper .portfolio-container,
.pm-portfolio-wrapper .portfolio-container * {
    box-sizing: border-box !important;
}

/* Subtle background pattern - scoped to portfolio container */
.pm-portfolio-wrapper .portfolio-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(123, 92, 230, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 204, 0, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
}

/* Ensure all portfolio content is above background */
.pm-portfolio-wrapper .portfolio-container > * {
    position: relative;
    z-index: 2;
}

/* Portfolio header */
.pm-portfolio-wrapper .portfolio-header {
    text-align: center !important;
    margin-bottom: 80px !important;
    position: relative !important;
    animation: fadeInDown 0.8s ease-out;
}

.pm-portfolio-wrapper .portfolio-tag {
    display: inline-block !important;
    background: transparent !important;
    color: #6B5CE6 !important;
    border: 1.5px solid #6B5CE6 !important;
    padding: 8px 24px !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    margin-bottom: 35px !important;
    transform: rotate(-2deg) !important;
    letter-spacing: 0.5px !important;
    transition: all 0.3s ease !important;
}

.pm-portfolio-wrapper .portfolio-tag:hover {
    transform: rotate(0deg) scale(1.05) !important;
    background: #6B5CE6 !important;
    color: white !important;
}

.pm-portfolio-wrapper .portfolio-header h1 {
    font-size: clamp(36px, 5vw, 52px) !important;
    font-weight: 700 !important;
    margin-bottom: 20px !important;
    color: #0a0a0a !important;
    position: relative !important;
    display: inline-block !important;
    letter-spacing: -0.5px !important;
}

.pm-portfolio-wrapper .portfolio-header h1::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 5px;
    background: #FFCC00;
    border-radius: 3px;
    animation: slideIn 0.6s ease-out 0.4s both;
}

/* Projects grid */
.pm-portfolio-wrapper .projects-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 32px !important;
    margin-bottom: 80px !important;
}

/* Project card */
.pm-portfolio-wrapper .project-card {
    background: white !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06) !important;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    cursor: pointer !important;
    transform: translateY(0) !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.pm-portfolio-wrapper .project-card:not(.placeholder):hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12) !important;
}

.pm-portfolio-wrapper .project-thumbnail {
    width: 100% !important;
    height: 260px !important;
    background: #f5f5f5 !important;
    position: relative !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

.pm-portfolio-wrapper .project-thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
    border: none !important;
    border-radius: 0 !important;
}

.pm-portfolio-wrapper .project-card:not(.placeholder):hover .project-thumbnail img {
    transform: scale(1.05) !important;
}

/* Project preview styles */
.pm-portfolio-wrapper .project-preview {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    color: #999 !important;
    background: #fafafa !important;
}

/* Specific project styles */
.pm-portfolio-wrapper .project-1 { 
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%) !important; 
}

.pm-portfolio-wrapper .project-2 { 
    background: linear-gradient(135deg, #4a1a7c 0%, #6b2eb3 100%) !important; 
}

.pm-portfolio-wrapper .project-3 { 
    background: linear-gradient(135deg, #0a1a0a 0%, #1a3a1a 100%) !important; 
}

.pm-portfolio-wrapper .project-4 { 
    background: linear-gradient(135deg, #1a0033 0%, #330066 100%) !important; 
}

.pm-portfolio-wrapper .project-5 { 
    background: linear-gradient(135deg, #4267B2 0%, #E1306C 100%) !important; 
}

.pm-portfolio-wrapper .project-6 { 
    background: linear-gradient(135deg, #2a3f5f 0%, #3d5a80 100%) !important; 
}

.pm-portfolio-wrapper .project-info {
    padding: 28px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: white !important;
    margin: 0 !important;
}

.pm-portfolio-wrapper .project-details h3 {
    font-size: 19px !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
    color: #0a0a0a !important;
    letter-spacing: -0.3px !important;
}

.pm-portfolio-wrapper .project-details p {
    font-size: 14px !important;
    color: #6e6e73 !important;
    line-height: 1.5 !important;
    margin: 0 !important;
}

.pm-portfolio-wrapper .project-arrow {
    width: 44px !important;
    height: 44px !important;
    background: #6B5CE6 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    flex-shrink: 0 !important;
    margin-left: 20px !important;
    border: none !important;
}

.pm-portfolio-wrapper .project-card:not(.placeholder):hover .project-arrow {
    background: #5A4BD5 !important;
    transform: rotate(45deg) !important;
}

.pm-portfolio-wrapper .project-arrow svg {
    width: 20px !important;
    height: 20px !important;
    stroke: white !important;
    stroke-width: 2.5 !important;
}

/* Project card hover description */
.pm-portfolio-wrapper .project-description {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: rgba(0, 0, 0, 0.95) !important;
    color: white !important;
    padding: 22px !important;
    transform: translateY(100%) !important;
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    font-size: 13px !important;
    line-height: 1.7 !important;
}

.pm-portfolio-wrapper .project-card:not(.placeholder):hover .project-description {
    transform: translateY(0) !important;
}

.pm-portfolio-wrapper .project-description strong {
    color: #FFD700 !important;
    font-weight: 600 !important;
}

/* Placeholder card styling */
.pm-portfolio-wrapper .project-card.placeholder {
    opacity: 0.7 !important;
    cursor: default !important;
    transition: opacity 0.3s ease !important;
}

.pm-portfolio-wrapper .project-card.placeholder:hover {
    opacity: 0.85 !important;
}

/* In Development badge */
.pm-portfolio-wrapper .development-badge {
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    background: rgba(0, 255, 0, 0.15) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(0, 255, 0, 0.3) !important;
    padding: 6px 14px !important;
    border-radius: 24px !important;
    font-size: 11px !important;
    color: #00FF00 !important;
    font-weight: 500 !important;
    letter-spacing: 0.5px !important;
    animation: pulse 2s ease-in-out infinite !important;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 80px;
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Responsive */
@media (max-width: 1024px) {
    .pm-portfolio-wrapper .projects-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .pm-portfolio-wrapper .portfolio-container {
        padding: 60px 20px !important;
    }

    .pm-portfolio-wrapper .portfolio-header h1 {
        font-size: 32px !important;
    }

    .pm-portfolio-wrapper .projects-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    .pm-portfolio-wrapper .project-thumbnail {
        height: 220px !important;
    }

    .pm-portfolio-wrapper .project-info {
        padding: 20px !important;
    }

    .pm-portfolio-wrapper .project-details h3 {
        font-size: 17px !important;
    }

    .pm-portfolio-wrapper .project-arrow {
        width: 40px !important;
        height: 40px !important;
    }
}

/* Project mockup content */
.pm-portfolio-wrapper .mockup-content {
    width: 100% !important;
    height: 100% !important;
    padding: 30px !important;
    color: white !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    position: relative !important;
}

.pm-portfolio-wrapper .mockup-content h4 {
    font-size: 16px !important;
    margin-bottom: 10px !important;
    opacity: 0.95 !important;
}

.pm-portfolio-wrapper .mockup-content p {
    font-size: 12px !important;
    opacity: 0.7 !important;
    margin: 0 !important;
}

/* Footer */
.pm-portfolio-wrapper .portfolio-footer {
    text-align: center !important;
    padding: 40px 0 !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
    margin-top: 80px !important;
    animation: fadeIn 0.8s ease-out 0.6s both !important;
}

.pm-portfolio-wrapper .portfolio-footer p {
    color: #6e6e73 !important;
    font-size: 14px !important;
    margin: 0 !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* View All Projects Button */
.pm-portfolio-wrapper .view-all-projects-btn {
    display: inline-block !important;
    background: #6B5CE6 !important;
    color: white !important;
    padding: 16px 32px !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    box-shadow: 0 4px 16px rgba(107, 92, 230, 0.3) !important;
    letter-spacing: -0.2px !important;
    position: relative !important;
    overflow: hidden !important;
    border: none !important;
}

/* Back to Homepage Button */
.pm-portfolio-wrapper .back-to-home-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: transparent !important;
    color: #6B5CE6 !important;
    padding: 16px 32px !important;
    border: 2px solid #6B5CE6 !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    letter-spacing: -0.2px !important;
    position: relative !important;
}

.pm-portfolio-wrapper .view-all-projects-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.pm-portfolio-wrapper .view-all-projects-btn:hover {
    background: #5A4BD5 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 24px rgba(107, 92, 230, 0.4) !important;
    color: white !important;
    text-decoration: none !important;
}

.pm-portfolio-wrapper .view-all-projects-btn:hover::before {
    transform: translateX(100%);
}

.pm-portfolio-wrapper .view-all-projects-btn:active {
    transform: translateY(-1px) !important;
}

.pm-portfolio-wrapper .view-all-projects-btn::after {
    content: '→';
    margin-left: 8px;
    transition: margin-left 0.3s ease;
}

.pm-portfolio-wrapper .view-all-projects-btn:hover::after {
    margin-left: 12px;
}

/* Back to Homepage Button Hover */
.pm-portfolio-wrapper .back-to-home-btn:hover {
    background: #6B5CE6 !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 24px rgba(107, 92, 230, 0.4) !important;
    text-decoration: none !important;
}

.pm-portfolio-wrapper .back-to-home-btn:active {
    transform: translateY(-1px) !important;
}

.pm-portfolio-wrapper .back-to-home-btn .back-arrow {
    font-size: 20px !important;
    transition: transform 0.3s ease !important;
}

.pm-portfolio-wrapper .back-to-home-btn:hover .back-arrow {
    transform: translateX(-3px) !important;
}

/* Add Project Button */
.pm-portfolio-wrapper .add-portfolio-btn {
    position: fixed !important;
    bottom: 40px !important;
    right: 40px !important;
    width: 64px !important;
    height: 64px !important;
    background: #6B5CE6 !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    font-size: 28px !important;
    font-weight: 400 !important;
    cursor: pointer !important;
    box-shadow: 0 8px 32px rgba(107, 92, 230, 0.35) !important;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    z-index: 1000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    backdrop-filter: blur(10px) !important;
    line-height: 1 !important;
}

.pm-portfolio-wrapper .add-portfolio-btn:hover {
    background: #5A4BD5 !important;
    transform: translateY(-4px) scale(1.05) rotate(90deg) !important;
    box-shadow: 0 12px 40px rgba(107, 92, 230, 0.45) !important;
}

/* Remove button for projects */
.pm-portfolio-wrapper .remove-project-btn {
    position: absolute !important;
    top: 16px !important;
    left: 16px !important;
    width: 36px !important;
    height: 36px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #0a0a0a !important;
    border: none !important;
    border-radius: 50% !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    opacity: 0 !important;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(10px) !important;
}

.pm-portfolio-wrapper .project-card:hover .remove-project-btn {
    opacity: 1 !important;
}

.pm-portfolio-wrapper .remove-project-btn:hover {
    background: #FF4444 !important;
    color: white !important;
    transform: scale(1.1) !important;
}

/* Modal Styles */
.pm-portfolio-wrapper .portfolio-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(10, 10, 10, 0.92) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2000 !important;
    animation: modalFadeIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    padding: 20px !important;
}

.pm-portfolio-wrapper .modal-content {
    background: #FFFFFF !important;
    border-radius: 20px !important;
    padding: 48px !important;
    max-width: 560px !important;
    width: 100% !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15) !important;
    animation: modalSlideUp 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    border: none !important;
    margin: 0 !important;
}

.pm-portfolio-wrapper .modal-content h2 {
    margin-bottom: 36px !important;
    font-size: 32px !important;
    font-weight: 700 !important;
    color: #0a0a0a !important;
    position: relative !important;
    padding-bottom: 20px !important;
}

.pm-portfolio-wrapper .modal-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: #FFCC00;
    border-radius: 2px;
}

.pm-portfolio-wrapper .form-group {
    margin-bottom: 24px !important;
}

.pm-portfolio-wrapper .form-group label {
    display: block !important;
    margin-bottom: 10px !important;
    font-weight: 600 !important;
    color: #0a0a0a !important;
    font-size: 14px !important;
}

.pm-portfolio-wrapper .form-group input,
.pm-portfolio-wrapper .form-group textarea,
.pm-portfolio-wrapper .form-group select {
    width: 100% !important;
    padding: 14px 18px !important;
    border: 2px solid #E8E8E8 !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    font-family: inherit !important;
    background: #FAFAFA !important;
    color: #0a0a0a !important;
    box-sizing: border-box !important;
}

.pm-portfolio-wrapper .form-group input:focus,
.pm-portfolio-wrapper .form-group textarea:focus,
.pm-portfolio-wrapper .form-group select:focus {
    outline: none !important;
    border-color: #6B5CE6 !important;
    box-shadow: 0 0 0 4px rgba(107, 92, 230, 0.12) !important;
    background: #FFFFFF !important;
}

.pm-portfolio-wrapper .form-group textarea {
    resize: vertical !important;
    min-height: 100px !important;
    line-height: 1.6 !important;
}

.pm-portfolio-wrapper .modal-actions {
    display: flex !important;
    gap: 16px !important;
    margin-top: 36px !important;
    justify-content: flex-end !important;
}

.pm-portfolio-wrapper .btn-cancel,
.pm-portfolio-wrapper .btn-submit {
    padding: 14px 28px !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    font-family: inherit !important;
}

.pm-portfolio-wrapper .btn-cancel {
    background: #F5F0E8 !important;
    color: #0a0a0a !important;
}

.pm-portfolio-wrapper .btn-cancel:hover {
    background: #E8E3D9 !important;
    transform: translateY(-1px) !important;
}

.pm-portfolio-wrapper .btn-submit {
    background: #6B5CE6 !important;
    color: white !important;
    box-shadow: 0 4px 16px rgba(107, 92, 230, 0.3) !important;
}

.pm-portfolio-wrapper .btn-submit:hover {
    background: #5A4BD5 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 24px rgba(107, 92, 230, 0.4) !important;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    from {
        transform: translateY(40px) scale(0.97);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}