:root {
    --bg-deep: #0a0a1a;
    --accent-purple: #9b51e0;
    --accent-magenta: #ff00ff;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --font-primary: 'Inter', sans-serif;
    --font-heading: 'Lexend', sans-serif;
}

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

body {
    background: transparent;
    color: var(--text-main);
    font-family: var(--font-primary);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#nebula-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at center, #1b0c3a 0%, #0a0a1a 100%);
}

/* Header */
header {
    padding: 2rem 4rem;
    z-index: 10;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px var(--accent-purple));
}

.logo h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

nav {
    display: flex;
    gap: 1rem;
}

/* Main Layout */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.portal-card {
    width: 100%;
    max-width: 1100px;
    min-height: 520px;
    border-radius: 2rem;
    display: flex;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
}

/* Sections */
.upload-section {
    flex: 6;
    padding: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.info-section {
    flex: 4;
    padding: 4rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
}

.info-section h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    line-height: 1.1;
    background: linear-gradient(135deg, #fff 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.info-section p {
    color: var(--text-dim);
    line-height: 1.6;
    font-size: 1.1rem;
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.socket-logo {
    font-weight: 700;
    color: var(--text-main);
}

/* View Handling */
.view-container {
    display: none;
    width: 100%;
    height: 100%;
}

.view-container.active {
    display: flex;
}

.hidden {
    display: none !important;
}

/* Sharing View */
.sharing-content {
    flex: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.sharing-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    background: linear-gradient(135deg, #ff00ff 0%, #9b51e0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sharing-subtitle {
    color: var(--text-main);
    font-weight: 600;
    font-size: 1.25rem;
}

.link-box {
    width: 100%;
    max-width: 600px;
    display: flex;
    padding: 0.5rem;
    border-radius: 1rem;
    gap: 0.5rem;
}

.link-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    outline: none;
}

.action-buttons {
    display: flex;
    gap: 1rem;
}

.btn-action {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
}

.expiry-settings {
    margin-top: 1rem;
    color: var(--text-dim);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.glass-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    outline: none;
}

/* Progress */
.progress-section {
    width: 100%;
    max-width: 500px;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-magenta));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-note {
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* Status Cards */
.status-summary {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
}

.status-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.25rem;
}

.status-icon.success {
    background: #10b981;
    color: white;
}

.status-info {
    display: flex;
    flex-direction: column;
}

.status-info strong {
    font-size: 1.1rem;
}

.status-info span {
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* Drop Zone */
.drop-zone {
    width: 100%;
    height: 100%;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent-purple);
    background: rgba(155, 81, 224, 0.05);
}

.drop-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.drop-text {
    color: var(--text-dim);
    font-size: 1.1rem;
}

.drop-footer {
    color: var(--text-dim);
    font-size: 0.85rem;
    opacity: 0.6;
}

/* Buttons */
.btn-primary {
    background: #c39dfc;
    color: #1a1a2e;
    border: none;
    padding: 0.85rem 2rem;
    border-radius: 0.75rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.btn-primary:hover {
    background: #d4b8ff;
    transform: translateY(-2px);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Footer */
footer {
    padding: 3rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    z-index: 10;
    width: 100%;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.1s;
}

.footer-links a:hover {
    color: var(--text-main);
}

.footer-copyright {
    color: var(--text-dim);
    font-size: 0.9rem;
    text-align: center;
    width: 100%;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    header { padding: 1.5rem 2rem; }
    .portal-card { min-height: auto; }
    .view-container { flex-direction: column; }
    .upload-section { order: 1; padding: 2rem; }
    .info-section { order: 2; padding: 3rem 2rem; text-align: center; }
    .security-badge { justify-content: center; }
    .footer-links { flex-wrap: wrap; justify-content: center; gap: 1rem; }
    footer { flex-direction: column; gap: 2rem; text-align: center; }
}

@media (max-width: 640px) {
    main { padding: 1rem; }
    .info-section h2 { font-size: 1.75rem; }
    .portal-card { border-radius: 1.5rem; }
    .upload-section { padding: 1.5rem; }
    .info-section { padding: 2rem 1.5rem; }
    .sharing-content { padding: 1.5rem; }
    .sharing-title { font-size: 1.75rem; }
    .link-box { flex-direction: column; }
    .link-box button { width: 100%; }
    .action-buttons { flex-direction: column; width: 100%; }
    .action-buttons button { width: 100%; justify-content: center; }
    .expiry-settings { flex-direction: column; }
}

/* Download View Layout */
.dl-layout {
    display: flex;
    width: 100%;
    min-height: 520px;
}

.dl-files-panel {
    flex: 4;
    padding: 3rem;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    border-right: 1px solid var(--glass-border);
}

.dl-actions-panel {
    flex: 6;
    padding: 3rem 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
    text-align: left;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-heading);
    font-weight: 600;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.04);
}

.file-item-icon {
    font-size: 1.75rem;
}

.file-item-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.file-item-info span:first-child {
    font-weight: 600;
    font-size: 1.1rem;
}

.file-item-info span:last-child {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.dl-title {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    background: linear-gradient(135deg, #fff 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.dl-desc {
    color: var(--text-dim);
    line-height: 1.6;
    font-size: 1.05rem;
}

.share-label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.action-buttons.small {
    margin-top: 1rem;
}

.dl-expiry {
    margin-top: 1rem;
    color: var(--text-dim);
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dl-utility-btns {
    display: flex;
    gap: 1rem;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--accent-purple);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.btn-text:hover {
    background: rgba(155, 81, 224, 0.1);
}

.sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Download Mobile Adjustments */
@media (max-width: 992px) {
    .dl-layout {
        flex-direction: column;
    }
    
    .dl-files-panel {
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        padding: 2.5rem;
    }
    
    .dl-actions-panel {
        padding: 2.5rem;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-backdrop {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.modal-content {
    position: relative;
    max-width: 440px;
    width: 90%;
    padding: 3.5rem 2.5rem;
    border-radius: 2.5rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(20, 20, 30, 0.7);
    z-index: 2001;
    transform: scale(0.9) translateY(30px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255,255,255,0.15);
    transform: rotate(90deg);
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff, var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-sub {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
}

.qr-container {
    background: white;
    padding: 1.25rem;
    border-radius: 2rem;
    display: inline-block;
    margin-bottom: 2.5rem;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

.qr-container img {
    display: block;
    width: 200px;
    height: 200px;
    image-rendering: auto;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Language Modal Styles */
.lang-modal-content {
    max-width: 600px;
    padding: 2.5rem;
}

.lang-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.lang-btn.active {
    background: rgba(200, 160, 255, 0.2);
    color: #fff;
    font-weight: 500;
}

.modal-footer-text {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.5;
    text-align: center;
}

.modal-footer-text a {
    color: var(--accent-purple);
    text-decoration: none;
}

.modal-footer-text a:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .lang-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
