/* Silk Road Academy - 3D Futuristic News Page Styles */

:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --primary-neon: #3b82f6;
    --accent-neon: #8b5cf6;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 25%);
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    perspective: 1000px;
}

/* --- Hero Section 3D --- */
.hero-section {
    height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    text-align: center;
    transform-style: preserve-3d;
    margin-bottom: 50px;
}

.hero-content {
    z-index: 2;
    transform: translateZ(50px);
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    text-shadow: 0 10px 30px rgba(59, 130, 246, 0.5);
    animation: floatTitle 6s ease-in-out infinite;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Animated Background Particles */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--primary-neon);
    border-radius: 50%;
    opacity: 0.5;
    animation: moveParticle 15s infinite linear;
}

@keyframes moveParticle {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(-100vh) translateX(50px); opacity: 0; }
}

@keyframes floatTitle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* --- Navigation & Filters --- */
.filters-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    z-index: 10;
    position: relative;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 12px 30px;
    border-radius: 30px;
    color: var(--text-main);
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--primary-neon);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
    transform: translateY(-3px);
    border-color: transparent;
}

/* --- 3D Feed Grid --- */
.feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    padding: 0 5%;
    max-width: 1400px;
    margin: 0 auto 100px;
}

/* --- 3D Card Styles --- */
.news-card-3d {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    box-shadow: var(--glass-shadow);
    transform-style: preserve-3d;
    transform: perspective(1000px);
    transition: transform 0.1s ease, box-shadow 0.3s ease; /* Fast transform for tilt */
    position: relative;
    overflow: hidden;
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.news-card-3d::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.news-card-3d:hover {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 20px rgba(59, 130, 246, 0.2);
    z-index: 10;
}

.card-content {
    transform: translateZ(20px); /* Depth effect */
}

.card-header-3d {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.author-avatar-3d {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-neon), var(--accent-neon));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin-left: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.author-info-3d h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-main);
}

.author-info-3d span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-body-3d {
    flex-grow: 1;
    margin-bottom: 20px;
}

.card-tag {
    display: inline-block;
    padding: 5px 12px;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-bottom: 10px;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.card-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #e2e8f0;
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

.card-text::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 40px;
    background: linear-gradient(transparent, var(--bg-card));
}

.read-more-btn {
    color: var(--primary-neon);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
    padding: 0;
    margin-top: 10px;
    display: block;
}

.card-footer-3d {
    display: flex;
    justify-content: space-between;
    align-items: center;
    transform: translateZ(30px); /* Pop out more */
    border-top: 1px solid var(--glass-border);
    padding-top: 15px;
}

.interact-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

.interact-btn:hover {
    color: var(--primary-neon);
}

/* Create Post Box 3D */
.create-post-container {
    max-width: 800px;
    margin: 0 auto 50px;
    perspective: 1000px;
    position: relative;
    z-index: 10;
}

.create-box-3d {
    background: rgba(15, 23, 42, 0.6);
    padding: 30px;
    border-radius: 25px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    transform: rotateX(5deg);
    transition: transform 0.4s ease;
}

.create-box-3d:hover {
    transform: rotateX(0deg) scale(1.02);
}

.input-3d {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 15px;
    color: white;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.input-3d:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-neon);
    outline: none;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.post-btn-3d {
    background: linear-gradient(90deg, var(--primary-neon), var(--accent-neon));
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-btn-3d:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem; }
    .hero-section { height: 40vh; }
    .feed-grid { grid-template-columns: 1fr; padding: 0 20px; }
}

/* Navbar Update for Dark Mode compatibility */
.header {
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: relative;
    z-index: 1000;
}

.nav-list a {
    color: var(--text-main) !important;
}

.logo span {
    color: var(--text-main) !important;
}

.logo i {
    color: var(--primary-neon) !important;
}

/* --- 3D Modal --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content-3d {
    background: var(--bg-dark);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 25px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 50px 100px rgba(0,0,0,0.5);
    overflow-y: auto;
    position: relative;
    transform: scale(0.8) translateY(50px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content-3d {
    transform: scale(1) translateY(0);
}

.modal-header-img {
    /* height: 250px; Remove fixed height */
    min-height: 100px; /* Add min height */
    background: linear-gradient(135deg, var(--primary-neon), var(--accent-neon));
    position: relative;
    overflow: hidden;
    padding-bottom: 20px; /* Add padding for content */
}

.modal-header-img::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 100px;
    background: linear-gradient(to top, var(--bg-dark), transparent);
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 40px;
    color: var(--text-main);
}

.modal-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-meta {
    color: var(--text-muted);
    margin-bottom: 30px;
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
}

.modal-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #e2e8f0;
    /* Add scroll for long content */
    max-height: 60vh; 
    overflow-y: auto;
}
