/* Portfolio Page Styles */

/* Hero Section */
.portfolio-hero {
    background: linear-gradient(135deg, #0A1929 0%, #07111d 100%);
    min-height: 70vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.portfolio-hero .hero-content {
    max-width: 600px;
    z-index: 2;
}

.portfolio-hero .hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #2ECC71 0%, #00D1FF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.portfolio-hero .hero-subtitle {
    font-size: 1.3rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.portfolio-visual {
    width: 400px;
    height: 400px;
    position: relative;
}

/* Portfolio Section */
.portfolio-section {
    padding: 5rem 0;
    background: var(--color-dark);
    min-height: 70vh;
}

/* Filter Buttons */
.portfolio-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: rgba(30, 42, 58, 0.6);
    border-radius: 15px;
    border: 1px solid rgba(46, 204, 113, 0.1);
}

.filter-btn {
    background: rgba(10, 25, 41, 0.8);
    color: var(--color-text-secondary);
    border: 1px solid rgba(46, 204, 113, 0.1);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(46, 204, 113, 0.1), transparent);
    transition: left 0.6s;
}

.filter-btn:hover {
    color: var(--color-text);
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.1);
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn.active {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.2);
}

.filter-btn.active i {
    animation: iconPulse 2s infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portfolio-item {
    background: rgba(30, 42, 58, 0.6);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(46, 204, 113, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    animation: itemAppear 0.6s ease forwards;
}

.portfolio-item.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@keyframes itemAppear {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.portfolio-item:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--color-accent);
    box-shadow: 0 15px 30px rgba(46, 204, 113, 0.15);
    z-index: 10;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-item:hover .portfolio-image img {
    transform: scale(1.1);
}

.portfolio-image {
    height: 250px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #1E2A3A 0%, #0A1929 100%);
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, 
                rgba(10, 25, 41, 0) 0%,
                rgba(10, 25, 41, 0.8) 70%,
                rgba(10, 25, 41, 0.95) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.overlay-content {
    margin-bottom: 1.5rem;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-item:hover .overlay-content {
    transform: translateY(0);
}

.overlay-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    color: var(--color-text);
    line-height: 1.3;
}

.overlay-content p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.portfolio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-category {
    background: rgba(46, 204, 113, 0.1);
    color: var(--color-accent);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.tag-featured {
    background: rgba(255, 193, 7, 0.1);
    color: #FFC107;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(255, 193, 7, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.portfolio-actions {
    display: flex;
    gap: 0.8rem;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

.portfolio-item:hover .portfolio-actions {
    transform: translateY(0);
}

.btn-view-details {
    background: var(--color-accent);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    flex: 1;
    justify-content: center;
}

.btn-view-details:hover {
    background: #25a25a;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(46, 204, 113, 0.2);
}

.btn-view-live {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.2);
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    flex: 1;
    justify-content: center;
}

.btn-view-live:hover {
    background: rgba(52, 152, 219, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(52, 152, 219, 0.2);
}

.portfolio-info {
    padding: 1.5rem;
    background: rgba(10, 25, 41, 0.5);
}

.portfolio-info h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 3rem;
}

.portfolio-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.portfolio-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.portfolio-meta i {
    color: var(--color-accent);
    font-size: 0.9rem;
}

/* Empty State */
.empty-portfolio {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-text-secondary);
}

.empty-portfolio i {
    font-size: 4rem;
    color: var(--color-accent);
    margin-bottom: 1.5rem;
    opacity: 0.5;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.empty-portfolio h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.empty-portfolio p {
    font-size: 1.1rem;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Portfolio Modal */
.portfolio-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 25, 41, 0.98);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.portfolio-modal-overlay.active {
    display: flex;
}

.portfolio-modal {
    background: var(--color-dark);
    border-radius: 20px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--color-accent);
    position: relative;
    animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.portfolio-modal .close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(46, 204, 113, 0.1);
    border: none;
    color: var(--color-text);
    font-size: 2rem;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

.portfolio-modal .close-modal:hover {
    background: var(--color-accent);
    color: white;
    transform: rotate(90deg);
}

.modal-content {
    padding: 0;
}

.modal-header {
    padding: 3rem 3rem 2rem;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.1) 0%, rgba(0, 209, 255, 0.05) 100%);
    border-bottom: 1px solid rgba(46, 204, 113, 0.2);
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
}

.modal-title {
    font-size: 2.2rem;
    color: var(--color-text);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.modal-subtitle {
    color: var(--color-accent);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(46, 204, 113, 0.1);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-secondary);
}

.meta-item i {
    color: var(--color-accent);
    font-size: 1rem;
}

.modal-body {
    padding: 2rem 3rem 3rem;
}

.modal-gallery {
    margin-bottom: 2rem;
}

.main-image {
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid rgba(46, 204, 113, 0.1);
}

.main-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}

.thumbnail-grid {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.thumbnail-item {
    width: 80px;
    height: 80px;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
    flex-shrink: 0;
}

.thumbnail-item.active {
    border-color: var(--color-accent);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-description {
    margin-bottom: 2rem;
}

.modal-description h3 {
    font-size: 1.4rem;
    color: var(--color-text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-description h3 i {
    color: var(--color-accent);
}

.modal-description p {
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.modal-features {
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.feature-item {
    background: rgba(46, 204, 113, 0.05);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--color-accent);
}

.feature-item h4 {
    color: var(--color-text);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.feature-item p {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.modal-technologies {
    margin-bottom: 2rem;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tech-tag {
    background: rgba(46, 204, 113, 0.1);
    color: var(--color-accent);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(46, 204, 113, 0.2);
    transition: all 0.3s;
}

.tech-tag:hover {
    background: var(--color-accent);
    color: white;
    transform: translateY(-2px);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(46, 204, 113, 0.1);
}

.modal-btn {
    padding: 0.8rem 2rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    flex: 1;
    justify-content: center;
}

.btn-live-demo {
    background: var(--color-accent);
    color: white;
}

.btn-live-demo:hover {
    background: #25a25a;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.2);
}

.btn-contact {
    background: transparent;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
}

.btn-contact:hover {
    background: rgba(46, 204, 113, 0.1);
    transform: translateY(-2px);
}

/* Loading Animation */
.portfolio-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(46, 204, 113, 0.1);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .portfolio-visual {
        width: 300px;
        height: 300px;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .portfolio-hero .hero-title {
        font-size: 2.8rem;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-body {
        padding: 2rem;
    }
    
    .modal-header {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .portfolio-hero .hero-title {
        font-size: 2.2rem;
    }
    
    .portfolio-hero .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-filter {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-btn {
        width: 100%;
        justify-content: center;
    }
    
    .portfolio-modal {
        margin: 1rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-content {
        padding: 0;
    }
    
    .main-image img {
        height: 300px;
    }
    
    .modal-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .portfolio-image {
        height: 200px;
    }
    
    .portfolio-overlay {
        padding: 1.5rem;
    }
    
    .overlay-content h3 {
        font-size: 1.2rem;
    }
    
    .portfolio-actions {
        flex-direction: column;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-header {
        padding: 1.5rem;
    }
    
    .main-image img {
        height: 200px;
    }
}

/* Animation for filtered items */
@keyframes filterIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes filterOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
}

.filter-in {
    animation: filterIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.filter-out {
    animation: filterOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Counter animation for stats */
.counter-animation {
    animation: countUp 1s ease-out forwards;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}