/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    color: #e0e0e0;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #505050 0%, #808080 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.btn-secondary {
    background: transparent;
    color: #a0a0a0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Main Wrapper with Sidebar */
.main-wrapper {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* Sidebar Trading Ad */
.sidebar-ad {
    position: sticky;
    top: 100px;
    width: 280px;
    flex-shrink: 0;
}

.trading-ad {
    display: block;
    background: rgba(20, 20, 20, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.trading-ad::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.trading-ad:hover::before {
    opacity: 1;
}

.trading-ad:hover {
    background: rgba(25, 25, 25, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.ad-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.trading-ad h3 {
    color: #e0e0e0;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.ad-subtitle {
    color: #909090;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.ad-link {
    display: inline-block;
    color: #a0a0a0;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.ad-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #a0a0a0;
    transition: width 0.3s ease;
}

.trading-ad:hover .ad-link {
    color: #c0c0c0;
}

.trading-ad:hover .ad-link::after {
    width: 100%;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
    flex-grow: 1;
    min-width: 0;
}

.post-card {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.post-media-container {
    position: relative;
    width: 100%;
    height: 250px;
    background: #1a1a1a;
    overflow: hidden;
}

.carousel-wrapper,
.carousel-wrapper-detail {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-slide {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.prev-btn,
.detail-prev-btn {
    left: 10px;
}

.next-btn,
.detail-next-btn {
    right: 10px;
}

.carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.carousel-indicators .indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicators .indicator.active {
    background: rgba(255, 255, 255, 0.9);
    width: 24px;
    border-radius: 4px;
}

.post-media {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: #1a1a1a;
}

.post-content {
    padding: 1.5rem;
}

.post-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #e0e0e0;
    margin-bottom: 0.5rem;
}

.post-description {
    color: #a0a0a0;
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-date {
    color: #666;
    font-size: 0.8rem;
    margin-top: 1rem;
}

.post-type-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #a0a0a0;
    margin-top: 0.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.empty-state p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-header h2 {
    font-size: 1.5rem;
    color: #e0e0e0;
}

.close-btn {
    background: none;
    border: none;
    color: #a0a0a0;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close-btn:hover {
    color: #e0e0e0;
}

.modal-body {
    padding: 1.5rem;
}

/* Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: #a0a0a0;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-group input[type="text"],
.form-group input[type="file"],
.form-group textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.75rem;
    color: #e0e0e0;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.4);
}

.form-group input[type="file"] {
    cursor: pointer;
}

.file-preview {
    margin-top: 1rem;
    border-radius: 8px;
    overflow: hidden;
}

.preview-item {
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-item img,
.preview-item video {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.pdf-preview-small {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    text-align: center;
    border-radius: 8px;
    height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pdf-preview-small .pdf-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.file-preview img,
.file-preview video {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
}

.file-preview .pdf-preview {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    text-align: center;
    border-radius: 8px;
}

.file-preview .pdf-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Detail Modal */
.modal-detail .modal-content {
    max-width: 900px;
}

.detail-content {
    padding: 2rem;
}

.detail-media-container {
    position: relative;
    width: 100%;
    max-height: 500px;
    background: #0a0a0a;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.carousel-wrapper-detail {
    width: 100%;
    min-height: 400px;
    position: relative;
}

.detail-media {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 8px;
    background: #0a0a0a;
}

.detail-title {
    font-size: 2rem;
    font-weight: 700;
    color: #e0e0e0;
    margin-bottom: 1rem;
}

.detail-description {
    color: #a0a0a0;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.detail-meta {
    color: #666;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-wrapper {
        flex-direction: column;
    }

    .sidebar-ad {
        position: relative;
        top: 0;
        width: 100%;
        max-width: 500px;
        margin: 2rem auto 0;
    }

    .posts-grid {
        margin-top: 1rem;
    }
}

@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .logo {
        font-size: 1.4rem;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .detail-title {
        font-size: 1.5rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}
