/* Reading Progress Bar */
.reading-progress-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    z-index: 9999;
}

.reading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00d4aa, #00b894);
    width: 0%;
    transition: width 0.1s ease;
    border-radius: 2px 0 0 2px;
    box-shadow: 0 0 10px rgba(0, 212, 170, 0.4);
}

/* Portfolio Article Styles - Based on Blog Article V3 */
.portfolio-article-v3 {
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    position: relative;
}

.portfolio-article-v3::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 255, 157, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 71, 87, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(131, 58, 180, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.project-hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding-bottom: 4rem; /* Spazio extra per i tag technologies */
}

.project-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.project-hero-content {
    position: relative;
    z-index: 2;
    color: white;
}

.project-back-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.project-back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    color: white;
}

.project-title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin: 1rem 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    color: white;
}

.project-excerpt {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 800px;
    color: #ffffff;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    margin: 1rem 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.project-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    color: white;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.project-tag {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.project-tag:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-1px);
}

.project-content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px 20px 0 0;
    margin-top: -50px;
    padding: 3rem 2rem;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-featured-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.project-body {
    color: #e2e2e2;
    line-height: 1.7;
    font-size: 1.1rem;
}

.project-body h1,
.project-body h2,
.project-body h3,
.project-body h4,
.project-body h5,
.project-body h6 {
    color: #ffffff;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.project-body h2 {
    font-size: 1.8rem;
    border-bottom: 2px solid #00d4aa;
    padding-bottom: 0.5rem;
}

.project-body h3 {
    font-size: 1.5rem;
}

.project-body p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.project-body img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 2rem 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.project-body blockquote {
    border-left: 4px solid #00d4aa;
    background: rgba(26, 26, 46, 0.7);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    border-radius: 0 10px 10px 0;
    font-style: italic;
    position: relative;
    color: #e2e2e2;
}

.project-body blockquote::before {
    content: '"';
    font-size: 4rem;
    color: #00d4aa;
    position: absolute;
    top: -10px;
    left: 10px;
    font-family: Georgia, serif;
}

.project-body pre {
    background: #1a1a2e;
    color: #ecf0f1;
    padding: 2rem;
    border-radius: 10px;
    overflow-x: auto;
    margin: 2rem 0;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-body code {
    background: rgba(26, 26, 46, 0.8);
    color: #00d4aa;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
}

.project-body pre code {
    background: none;
    color: #ecf0f1;
    padding: 0;
}

.project-body ul,
.project-body ol {
    padding-left: 2rem;
    margin-bottom: 1.5rem;
}

.project-body li {
    margin-bottom: 0.5rem;
}

.project-body a {
    color: #007bff;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.project-body a:hover {
    color: #0056b3;
    border-bottom-color: #0056b3;
}

.project-sidebar {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    margin-top: -50px;
    position: relative;
    z-index: 2;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-section-title i {
    color: #00d4aa;
}

.info-grid {
    display: grid;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #ffffff;
}

.info-value {
    color: #b8b8c3;
    text-align: right;
}

.social-share-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.social-btn {
    padding: 0.75rem;
    border-radius: 10px;
    text-decoration: none;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.social-btn--linkedin {
    background: #0077b5;
    color: white;
}

.social-btn--twitter {
    background: #1da1f2;
    color: white;
}

.social-btn--copy {
    background: #6c757d;
    color: white;
}

.social-btn--back {
    background: #28a745;
    color: white;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    color: white;
}

.project-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.project-status-badge.completed {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.project-status-badge.in_progress {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.project-status-badge.planned {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tech-badge {
    background: #e9ecef;
    color: #495057;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #dee2e6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .project-hero {
        min-height: 50vh;
        text-align: center;
    }
    
    .project-title {
        font-size: 2rem;
    }
    
    .project-content-wrapper {
        margin-top: -30px;
        padding: 2rem 1rem;
    }
    
    .project-sidebar {
        margin-top: 2rem;
        padding: 1.5rem;
    }
    
    .project-meta {
        justify-content: center;
    }
    
    .social-share-grid {
        grid-template-columns: 1fr;
    }
    
    .project-body {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .project-content-wrapper {
        border-radius: 15px 15px 0 0;
        padding: 1.5rem 1rem;
    }
    
    .project-meta {
        gap: 0.5rem;
    }
    
    .project-meta-item {
        font-size: 0.8rem;
        padding: 0.25rem 0.6rem;
    }
}

/* Back to Portfolio Button */
.back-to-portfolio-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: rgba(26, 26, 46, 0.8);
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 2rem auto;
    text-align: center;
    max-width: 200px;
    backdrop-filter: blur(10px);
}

.back-to-portfolio-btn:hover {
    background: rgba(0, 212, 170, 0.2);
    border-color: #00d4aa;
    color: #00d4aa;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.2);
}

.back-to-portfolio-btn i {
    font-size: 0.8rem;
}

/* Footer spacing */
.portfolio-article-v3 > *:last-child {
    margin-bottom: 3rem;
}

/* Toast styles */
.custom-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    border-radius: 15px;
    border: none;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: slideInRight 0.3s ease-out;
    padding: 10px 14px;
    color: #fff;
}
.custom-toast__content {
    display: flex;
    align-items: center;
    gap: 10px;
}
.custom-toast--success { background: rgba(25, 135, 84, 0.9); }
.custom-toast--error { background: rgba(220, 53, 69, 0.9); }
.custom-toast--hide { animation: slideOutRight 0.3s ease-in forwards; }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}
