:root {
    --primary: #00d4ff;
    --secondary: #0099ff;
    --dark: #0a0e27;
    --darker: #050814;
    --light: #f8f9fa;
    --gray: #6c757d;
    --tech-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.98);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #333;
    background: var(--light);
}

/* Header */
header {
    background: var(--dark);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 212, 255, 0.3);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
}

.main-nav a:hover {
    color: var(--primary);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s;
}

.main-nav a:hover::after {
    width: 100%;
}

/* Search in Header */
.search-header {
    margin-left: auto;
}

.search-header form {
    display: flex;
    gap: 0.5rem;
}

.search-header input {
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
    width: 200px;
    transition: all 0.3s;
}

.search-header input:focus {
    outline: none;
    background: white;
    color: #333;
    width: 250px;
}

.search-header input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-header input:focus::placeholder {
    color: #999;
}

.search-header button {
    padding: 0.5rem 1rem;
    border: none;
    background: var(--primary);
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.search-header button:hover {
    transform: scale(1.1);
}

/* Breadcrumb */
.breadcrumb {
    background: white;
    padding: 1rem 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.breadcrumb ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.breadcrumb li a {
    color: var(--secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb li a:hover {
    color: var(--primary);
}

.breadcrumb li:not(:last-child)::after {
    content: '›';
    margin-left: 0.5rem;
    color: var(--gray);
    font-size: 1.2rem;
}

.breadcrumb li:last-child {
    color: var(--gray);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5rem 2rem;
    text-align: center;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.hero p {
    font-size: 1.3rem;
    opacity: 0.95;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Post Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.post-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(0, 212, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 212, 255, 0.2);
}

.post-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-bottom: 3px solid var(--primary);
}

.post-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-category {
    display: inline-block;
    background: var(--tech-gradient);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    text-decoration: none;
    transition: transform 0.3s;
    align-self: flex-start;
}

.post-category:hover {
    transform: scale(1.05);
}

.post-title {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
    flex-grow: 1;
}

.post-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.post-title a:hover {
    color: var(--secondary);
}

.post-excerpt {
    color: var(--gray);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--gray);
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
}

/* Single Post */
.single-post {
    margin: 0 auto;
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.single-post h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--dark);
    line-height: 1.2;
}

.single-post .post-meta {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e9ecef;
}

.single-post .featured-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2rem 0;
}

.post-body {
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-body h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    color: var(--dark);
}

.post-body h3 {
    font-size: 1.4rem;
    margin: 1.5rem 0 0.8rem;
    color: var(--secondary);
}

.post-body p {
    margin-bottom: 1.2rem;
    line-height: 1.8;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.post-body ul,
.post-body ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.post-body li {
    margin-bottom: 0.5rem;
}

.post-body code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #c7254e;
}

.post-body pre {
    background: var(--dark);
    color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-body pre code {
    background: none;
    color: #fff;
    padding: 0;
}

.post-body blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--gray);
}

.post-body a {
    color: var(--secondary);
    text-decoration: none;
    border-bottom: 2px solid var(--primary);
    transition: all 0.3s;
}

.post-body a:hover {
    color: var(--primary);
}

.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.post-body table th,
.post-body table td {
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    text-align: left;
}

.post-body table th {
    background: var(--light);
    font-weight: 600;
}

/* Related Posts */
.related-posts {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 3px solid var(--primary);
}

.related-posts h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    background: var(--tech-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* Category Header */
.category-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.category-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: var(--tech-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 3rem 0;
}

.pagination a,
.pagination span {
    padding: 0.6rem 1rem;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 8px;
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    transition: all 0.3s;
    min-width: 45px;
    text-align: center;
    display: inline-block;
}

.pagination a:hover {
    background: var(--tech-gradient);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.pagination span.current {
    background: var(--tech-gradient);
    color: white;
    border-color: transparent;
}

.pagination span.dots {
    border: none;
    background: transparent;
    color: var(--gray);
    cursor: default;
}

/* Search Form */
.search-form {
    max-width: 600px;
    margin: 2rem auto;
}

.search-form form {
    display: flex;
    gap: 0.5rem;
}

.search-form input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 2px solid var(--primary);
    border-radius: 8px;
    font-size: 1rem;
}

.search-form button {
    padding: 0.8rem 2rem;
    background: var(--tech-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s;
}

.search-form button:hover {
    transform: translateY(-2px);
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Footer */
footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

footer p {
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

/* 404 Page */
.error-page {
    text-align: center;
    padding: 5rem 2rem;
}

.error-page h1 {
    font-size: 6rem;
    margin-bottom: 1rem;
    background: var(--tech-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.error-page h2 {
    margin-bottom: 1rem;
}

.error-page p {
    color: var(--gray);
    margin-bottom: 2rem;
}

/* Buttons */
.btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--tech-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Responsive Design */
@media (max-width: 992px) {
    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .related-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .header-container {
        flex-wrap: wrap;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-header {
        order: 3;
        width: 100%;
        margin-top: 1rem;
    }
    
    .search-header input {
        width: 100%;
    }
    
    .search-header input:focus {
        width: 100%;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .single-post {
        padding: 1.5rem;
    }
    
    .single-post h1 {
        font-size: 2rem;
    }
    
    .post-body {
        font-size: 1rem;
    }
    
    .breadcrumb {
        padding: 0.8rem 1rem;
    }
    
    .breadcrumb ul {
        font-size: 0.85rem;
    }
    
    .pagination {
        gap: 0.3rem;
    }
    
    .pagination a,
    .pagination span {
        padding: 0.5rem 0.8rem;
        min-width: 40px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    .hero {
        padding: 3rem 1rem;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .single-post {
        padding: 1rem;
    }
    
    .logo {
        font-size: 1.4rem;
    }
    
    .pagination a,
    .pagination span {
        padding: 0.4rem 0.6rem;
        min-width: 35px;
        font-size: 0.85rem;
    }
}

/* Print Styles */
@media print {
    header,
    footer,
    .search-header,
    .breadcrumb,
    .pagination,
    .related-posts,
    .btn {
        display: none;
    }
    
    .single-post {
        box-shadow: none;
        padding: 0;
    }
}

/* Accessibility */
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Loading Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: fadeIn 0.5s ease-out;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background: var(--primary);
    color: white;
}

::-moz-selection {
    background: var(--primary);
    color: white;
}

/* Menu Toggle (Hamburger) */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    transition: all 0.3s;
    border-radius: 3px;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Modifica la sezione Responsive esistente */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .header-container {
        flex-wrap: wrap;
        position: relative;
    }
    
    .menu-toggle {
        display: flex;
        order: 2;
    }
    
    .logo {
        order: 1;
    }
    
    .main-nav {
        order: 4;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
    }
    
    .main-nav.active {
        max-height: 300px;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
    }
    
    .main-nav li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .main-nav a {
        display: block;
        padding: 1rem;
    }
    
    .main-nav a::after {
        display: none;
    }
    
    .search-header {
        order: 3;
        width: 100%;
        margin-top: 1rem;
    }
    
    .search-header input {
        width: calc(100% - 60px);
    }
    
    .search-header input:focus {
        width: calc(100% - 60px);
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .single-post {
        padding: 1.5rem;
    }
    
    .single-post h1 {
        font-size: 2rem;
    }
    
    .post-body {
        font-size: 1rem;
    }
    
    .breadcrumb {
        padding: 0.8rem 1rem;
    }
    
    .breadcrumb ul {
        font-size: 0.85rem;
    }
    
    .pagination {
        gap: 0.3rem;
    }
    
    .pagination a,
    .pagination span {
        padding: 0.5rem 0.8rem;
        min-width: 40px;
        font-size: 0.9rem;
    }
}

iframe { 
  width: 100%;
  aspect-ratio: 16 / 9;
}

/* Share Links */
.share-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2.5rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 12px;
    border-left: 4px solid var(--primary);
}

.share-label {
    font-weight: 600;
    color: var(--dark);
    font-size: 1rem;
}

.share-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
}

.share-btn svg {
    width: 22px;
    height: 22px;
    transition: transform 0.3s ease;
}

.share-btn:hover svg {
    transform: scale(1.15);
}

.share-btn.facebook {
    background: #1877f2;
    color: white;
}

.share-btn.facebook:hover {
    background: #0d65d9;
    box-shadow: 0 4px 15px rgba(24, 119, 242, 0.4);
}

.share-btn.twitter {
    background: #000000;
    color: white;
}

.share-btn.twitter:hover {
    background: #1a1a1a;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.share-btn.linkedin {
    background: #0077b5;
    color: white;
}

.share-btn.linkedin:hover {
    background: #006399;
    box-shadow: 0 4px 15px rgba(0, 119, 181, 0.4);
}

.share-btn.whatsapp {
    background: #25d366;
    color: white;
}

.share-btn.whatsapp:hover {
    background: #1fb855;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}

.share-btn.email {
    background: var(--secondary);
    color: white;
}

.share-btn.email:hover {
    background: var(--primary);
    box-shadow: 0 4px 15px rgba(0, 153, 255, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .share-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .share-buttons {
        width: 100%;
        justify-content: center;
    }
}
