/* Stili personalizzati per il Blog */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #4ade80;
    --warning-color: #fbbf24;
    --dark-color: #1e293b;
    --light-bg: #f8fafc;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(240, 147, 251, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
    z-index: -1;
}

.container.content-container {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 40px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 1200px;
}

.container:not(.content-container) {
    background: transparent;
}

/* Gradient Background */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 70%, var(--accent-color) 100%);
    position: relative;
    overflow: hidden;
}

.bg-gradient-primary::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); }
}

/* Navbar */
.navbar {
    background: rgba(102, 126, 234, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    min-height: 70px;
    padding: 1rem 0 !important;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    padding: 0.5rem 0 !important;
    line-height: 1.5 !important;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-nav .nav-link {
    padding: 0.5rem 1rem !important;
    line-height: 1.5 !important;
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #5568d3 0%, #6b47a0 50%, #d16ee3 100%);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    padding: 2.5rem 0 !important;
    min-height: 160px;
    z-index: 1;
}

.hero-section .container {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 50%, rgba(255,255,255,0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(255,255,255,0.1) 0%, transparent 40%),
        linear-gradient(180deg, rgba(0,0,0,0.1) 0%, transparent 100%);
}

.hero-section h1 {
    position: relative;
    z-index: 1;
    text-shadow: 3px 3px 12px rgba(0, 0, 0, 0.5);
    font-weight: 700 !important;
    color: #ffffff !important;
    margin-bottom: 0.75rem !important;
    font-size: 2.5rem !important;
    line-height: 1.2 !important;
}

.hero-section p {
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4);
    font-size: 1.1rem !important;
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 400;
    margin-bottom: 0 !important;
    line-height: 1.4 !important;
}

/* Card Styling */
.card {
    border: none;
    border-radius: 15px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: white;
    border: 1px solid rgba(102, 126, 234, 0.1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s;
}

.card:hover::before {
    left: 100%;
}

.post-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(102, 126, 234, 0.3),
        0 0 0 1px rgba(102, 126, 234, 0.2);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    color: white !important;
    font-weight: 600;
    border-radius: 15px 15px 0 0 !important;
}

/* Sidebar */
.sidebar-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(240, 147, 251, 0.05));
    border: 2px solid rgba(102, 126, 234, 0.2) !important;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
}

.list-group-item {
    border: none;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
    background: transparent;
}

.list-group-item:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1), transparent);
    padding-left: 1.5rem;
    border-left: 3px solid var(--primary-color);
}

.list-group-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    border-left: 4px solid var(--accent-color);
}

.list-group-item a {
    color: inherit;
    text-decoration: none;
    display: block;
}

/* Sticky Sidebar */
.sticky-sidebar {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

/* Post Content Styling */
.post-content {
    line-height: 1.8;
    font-size: 1.05rem;
    color: #2d3748;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.post-content h1, .post-content h2, .post-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.post-content p {
    margin-bottom: 1rem;
}

.post-content ul, .post-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #6c757d;
}

.post-content code {
    background-color: #f1f3f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.post-content pre {
    background-color: #2d3748;
    color: #fff;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

/* Video Responsive */
.post-content iframe {
    max-width: 100%;
    border-radius: 8px;
    margin: 20px 0;
}

/* Meta informazioni post */
.post-meta {
    font-size: 0.9rem;
}

.post-meta a {
    color: var(--primary-color);
}

.post-meta a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Badges */
.badge {
    font-weight: 600;
    padding: 0.5em 1em;
    border-radius: 20px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.badge.bg-secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563) !important;
}

/* Buttons */
.btn {
    font-weight: 600;
    border-radius: 10px;
    padding: 10px 24px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: translateY(-3px);
}

/* Footer Sticky */
footer {
    margin-top: auto;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
}

/* Main Content Wrapper */
.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Meta Post */
.post-meta {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(240, 147, 251, 0.1));
    padding: 10px 15px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.post-meta i {
    color: var(--primary-color);
}

/* Excerpt */
.post-excerpt {
    color: #64748b;
    line-height: 1.8;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        min-height: 60px !important;
        padding: 0.5rem 0 !important;
    }
    
    .navbar-brand {
        font-size: 1.25rem !important;
        padding: 0.25rem 0 !important;
    }
    
    .navbar-collapse {
        background: rgba(102, 126, 234, 0.98);
        padding: 1rem;
        margin-top: 0.5rem;
        border-radius: 8px;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
    }
    
    .hero-section {
        min-height: 140px !important;
        padding: 1.5rem 0 !important;
        margin-top: 0 !important;
    }
    
    .hero-section h1 {
        font-size: 1.75rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .hero-section p {
        font-size: 0.95rem !important;
        line-height: 1.3 !important;
    }
    
    .post-content {
        font-size: 1rem;
    }
    
    .post-content img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    .sticky-sidebar {
        position: relative !important;
        top: 0 !important;
    }
    
    .content-container {
        padding: 20px !important;
        margin-top: 20px !important;
        margin-bottom: 20px !important;
    }
    
    .container {
        padding: 15px;
    }
}

/* Tablet */
@media (max-width: 992px) {
    .hero-section h1 {
        font-size: 2rem !important;
    }
    
    .hero-section p {
        font-size: 1rem !important;
    }
    
    .sticky-sidebar {
        position: relative !important;
        top: 0 !important;
    }
}

/* Animazioni */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

article {
    animation: fadeIn 0.5s ease;
}

/* Print Styling */
@media print {
    .navbar, .hero-section, footer, .btn, .post-meta {
        display: none;
    }
    
    .container {
        max-width: 100%;
    }
}
