@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Inter:wght@400;600;700&display=swap');

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #030303;
    --card: rgba(8, 8, 8, 0.9);
    --card-strong: rgba(18, 18, 18, 0.95);
    --border: #ff7a18;
    --border-soft: rgba(255, 122, 24, 0.35);
    --text: #f5f5f5;
    --muted: #a3a3a3;
    --accent: #ff7a18;
    --accent-2: #ffb347;
    --shadow: 0 25px 80px rgba(0, 0, 0, 0.65);
}

body {
    font-family: 'Inter', 'JetBrains Mono', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: radial-gradient(120% 120% at 20% 20%, rgba(255, 122, 24, 0.1), transparent 45%),
                radial-gradient(120% 120% at 80% 10%, rgba(255, 179, 71, 0.15), transparent 55%),
                linear-gradient(180deg, #050505 0%, #020202 50%, #050505 100%);
    min-height: 100vh;
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 940px;
    margin: 0 auto;
    padding: 32px 24px 60px;
    min-height: 100vh;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 32px;
    color: var(--text);
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.03em;
    text-shadow: 0 15px 40px rgba(0,0,0,0.6);
}

header p {
    font-size: 1.05rem;
    opacity: 0.8;
    text-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

/* Post box */
.post-box {
    background: var(--card);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-soft);
}

/* Tabs */
.tabs {
    display: flex;
    background: rgba(255, 122, 24, 0.08);
    border-bottom: 1px solid var(--border-soft);
}

.tab-button {
    flex: 1;
    padding: 16px 20px;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.tab-button.active {
    background: rgba(255, 122, 24, 0.15);
    color: var(--text);
    border-bottom: 3px solid var(--accent);
}

.tab-button:hover:not(.active) {
    background: rgba(255, 122, 24, 0.1);
    color: var(--text);
}

/* Tab content */
.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

/* Form styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.02em;
}

.form-group input[type="url"],
.form-group input[type="file"],
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(20, 20, 20, 0.9);
    color: var(--text);
}

.form-group input[type="url"]:focus,
.form-group input[type="file"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 8px 25px rgba(255, 122, 24, 0.35);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 122, 24, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Posts container */
.posts-container {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Individual post */
.post {
    background: var(--card);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-soft);
    transition: all 0.3s ease;
    width: 100%;
    max-width: 760px;
}

.post:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 60px rgba(255, 122, 24, 0.2);
    border-color: var(--accent);
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.post-number {
    font-weight: 700;
    color: var(--accent);
    margin-right: 10px;
    letter-spacing: 0.02em;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 12px;
}

.post-meta {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-time {
    color: var(--muted);
    font-size: 0.9rem;
}

.post-share {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.post-share:hover {
    text-decoration: underline;
}

.post-content {
    margin-bottom: 15px;
    width: 100%;
}

.post-comment {
    color: var(--text);
    margin-bottom: 10px;
    font-size: 1rem;
}

.post-link {
    display: inline-block;
    padding: 8px 16px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.post-link:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.link-preview {
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 122, 24, 0.05);
    box-shadow: inset 0 1px 0 rgba(255, 122, 24, 0.2);
}

.preview-content {
    display: grid;
    grid-template-columns: 160px 1fr;
    text-decoration: none;
    color: inherit;
}

.preview-cover {
    position: relative;
    min-height: 110px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
}

.preview-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.play-badge {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.platform-chip {
    position: absolute;
    left: 12px;
    bottom: 12px;
    background: rgba(0,0,0,0.45);
    color: white;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    letter-spacing: 0.01em;
}

.preview-meta {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.preview-title {
    font-weight: 700;
    color: var(--accent-2);
    letter-spacing: -0.01em;
}

.preview-url {
    color: var(--muted);
    font-size: 0.9rem;
    word-break: break-all;
}

.embed-shell {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow);
    margin-bottom: 10px;
    border: 1px solid var(--border-soft);
}

.embed-shell iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.open-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255, 122, 24, 0.08);
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.25s ease;
}

.open-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}

.post-media {
    margin-top: 15px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    width: 100%;
    border: 1px solid var(--border-soft);
}

.post-media img {
    width: 100%;
    height: auto;
    display: block;
}

.post-media video {
    width: 100%;
    height: auto;
    display: block;
}

.video-shell {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}

.video-shell video {
    display: block;
}

/* Loading and error states */
.loading {
    text-align: center;
    padding: 30px;
    color: var(--text);
    font-size: 1.1rem;
}

.error-message {
    background: rgba(255, 99, 71, 0.15);
    border: 1px solid rgba(255, 122, 24, 0.5);
    color: #ffd7c2;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: center;
}

.success-message {
    background: rgba(255, 122, 24, 0.12);
    border: 1px solid rgba(255, 122, 24, 0.45);
    color: #ffe7d3;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2.4rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .post {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-button {
        border-bottom: 1px solid #e9ecef;
    }
    
    .tab-button:last-child {
        border-bottom: none;
    }
    
    .tab-button.active {
        border-bottom: 1px solid #e9ecef;
        border-right: 3px solid #667eea;
    }

    .preview-content {
        grid-template-columns: 1fr;
    }
}

/* Animation for new posts */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post.new {
    animation: slideIn 0.5s ease-out;
}

/* File upload styling */
input[type="file"] {
    position: relative;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 14px;
    padding: 24px;
    background: rgba(255, 122, 24, 0.04);
    position: relative;
    transition: all 0.3s ease;
    text-align: center;
}

.drop-zone-inner {
    pointer-events: none;
    color: var(--muted);
    display: grid;
    gap: 6px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.drop-zone.dragover {
    border-color: var(--accent);
    box-shadow: 0 12px 30px rgba(255, 122, 24, 0.25);
    background: rgba(255, 122, 24, 0.08);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.empty-state p {
    opacity: 0.8;
    font-size: 1.1rem;
}
