:root {
    --header-height-mobile: 52px;
    --header-height-desktop: 56px;
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #222a3e;
    min-height: 100vh;
    font-family: var(--font-primary);
    padding-top: var(--header-height-mobile);
    color: #fff;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(10, 14, 26, 0.8);
    backdrop-filter: blur(10px);
    height: var(--header-height-mobile);
    z-index: 1000;
    transition: all 0.3s ease;
    border-bottom: none;
    margin-bottom: 0;
}

.header.scrolled {
    background-color: rgba(10, 14, 26, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.header-right {
    display: flex;
    align-items: center;
}

/* TON Connect button size */
#ton-connect button {
    padding: 8px 16px !important;
    font-size: 15px !important;
    height: auto !important;
}

/* Tabs */
.tabs-nav {
    background-color: rgba(10, 14, 26, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-top: none;
    position: fixed;
    top: var(--header-height-mobile);
    left: 0;
    right: 0;
    z-index: 999;
    margin: 0;
    padding: 0;
}

main {
    padding-top: 48px;
}

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

.tab-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 16px 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    font-family: var(--font-primary);
}

.tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: #3f88f8;
    border-bottom-color: #3f88f8;
}

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

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

.brand-logo {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.brand-logo svg {
    width: 100%;
    height: 100%;
}

/* Desktop Styles */
@media (min-width: 768px) {
    body {
        padding-top: var(--header-height-desktop);
    }

    .header {
        height: var(--header-height-desktop);
    }

    .header-container {
        padding: 0 24px;
    }

    .header-brand {
        font-size: 18px;
    }

    .brand-logo {
        width: 32px;
        height: 32px;
    }

    .tabs-nav {
        top: var(--header-height-desktop);
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .header-container {
        padding: 0 16px;
    }

    .header-brand {
        font-size: 15px;
        gap: 8px;
    }

    .brand-logo {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .header {
        height: 48px;
    }

    body {
        padding-top: 48px;
    }

    .header-brand {
        font-size: 14px;
        gap: 6px;
    }

    .brand-logo {
        width: 22px;
        height: 22px;
    }

    footer {
        padding: 20px 0;
        margin-top: 30px;
    }

    .footer-content {
        justify-content: space-between;
        gap: 16px;
    }
}

/* Footer */
footer {
    padding: 24px 0;
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

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

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    text-decoration: none;
}

.footer-logo {
    width: 20px;
    height: 20px;
}

.footer-logo svg {
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .footer-content {
        gap: 20px;
        font-size: 13px;
    }

    .footer-logo {
        width: 18px;
        height: 18px;
    }
}

/* Upload Section */
.upload-section {
    padding: 12px 0 20px 0;
    max-width: 700px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 14px;
}

.section-header h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #fff;
}

.subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.upload-form {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
}

.wallet-required {
    text-align: center;
    padding: 30px 16px;
}

.wallet-required h3 {
    font-size: 18px;
    color: #fff;
    margin-bottom: 6px;
}

.wallet-required p {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 12px;
    font-size: 14px;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #fff;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 14px;
    color: #fff;
    font-family: var(--font-primary);
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3f88f8;
    background: rgba(255, 255, 255, 0.08);
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.form-group small span {
    color: #3f88f8;
    font-weight: 500;
}

/* Tags Input */
.tags-input-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    min-height: 40px;
    transition: all 0.2s;
}

.tags-input-container:focus-within {
    border-color: #3f88f8;
    background: rgba(255, 255, 255, 0.08);
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag-badge {
    background: linear-gradient(135deg, #3f88f8, #5a9eff);
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    animation: tagSlideIn 0.2s ease;
}

@keyframes tagSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tag-badge .tag-remove {
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.tag-badge .tag-remove:hover {
    opacity: 1;
}

#tagsInput {
    flex: 1;
    min-width: 120px;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 15px;
    font-family: var(--font-primary);
    padding: 4px;
}

#tagsInput::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Upload Area */
.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #3f88f8;
    background: rgba(63, 136, 248, 0.05);
}

.upload-area svg {
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 10px;
    width: 32px;
    height: 32px;
}

.upload-area p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* File List */
.file-list {
    margin-top: 10px;
}

.file-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-item span {
    font-size: 14px;
    color: #fff;
}

.file-item button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 18px;
}

.file-item button:hover {
    color: #ff4444;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    background: linear-gradient(90deg, #3f88f8, #5a9eff);
    color: #fff;
    border: none;
    padding: 11px;
    border-radius: 7px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 14px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(63, 136, 248, 0.4);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Projects List */
.projects-list {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.projects-list h3 {
    font-size: 22px;
    margin-bottom: 24px;
    color: #fff;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.project-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 14px 16px;
    transition: all 0.25s ease;
    cursor: pointer;
}

.project-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: #3f88f8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(63, 136, 248, 0.15);
}

.project-card h4 {
    font-size: 18px;
    margin-bottom: 6px;
    color: #ffffff;
    font-weight: 600;
}

.project-card p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.tag-display {
    background: rgba(63, 136, 248, 0.12);
    color: #3f88f8;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.project-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.project-owner {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    font-family: monospace;
}

.project-card a {
    color: #3f88f8;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.project-card a:hover {
    color: #5a9eff;
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .upload-section {
        padding: 40px 0;
    }

    .connect-wallet {
        padding: 60px 20px;
    }

    .connect-wallet h2 {
        font-size: 26px;
    }

    .upload-area {
        padding: 32px 16px;
    }

    .tabs-container {
        padding: 0 16px;
    }

    .tab-btn {
        padding: 12px 16px;
        font-size: 14px;
    }

    .tabs-nav {
        top: var(--header-height-mobile);
    }
}

@media (max-width: 480px) {
    .tabs-nav {
        top: 48px;
    }

    .tab-btn {
        padding: 12px 12px;
        font-size: 13px;
    }
}
