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

:root {
    --bg: #ffffff;
    --text: #000000;
    --accent: #0066ff;
    --border: #e0e0e0;
    --hover: #f5f5f5;
    --modal-bg: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg: #000000;
    --text: #ffffff;
    --accent: #0066ff;
    --border: #333333;
    --hover: #1a1a1a;
    --modal-bg: #0a0a0a;
    --shadow: rgba(255, 255, 255, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background 0.2s, color 0.2s;
}

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

.navbar {
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
}

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

.logo {
    font-size: 24px;
    font-weight: 600;
}

.nav-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.theme-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    color: var(--text);
}

.theme-btn:hover {
    background: var(--hover);
}

.theme-btn i {
    color: var(--text);
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: none;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.btn-secondary:hover {
    background: var(--hover);
}

.btn-secondary i {
    color: var(--text);
}

.btn-large {
    background: var(--accent);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    margin-top: 30px;
}

.btn-large:hover {
    opacity: 0.9;
}

.hero {
    text-align: center;
    padding: 80px 20px;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.subtitle {
    font-size: 20px;
    color: var(--text);
    opacity: 0.7;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-top: 80px;
}

.feature {
    text-align: center;
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.feature-icon i {
    color: var(--accent);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.file-icon {
    font-size: 18px;
    width: 20px;
    display: inline-block;
    text-align: center;
    color: var(--text);
}

.file-icon i {
    color: var(--text);
}

.auth-btn i {
    margin-right: 8px;
    color: var(--text);
}

.btn-primary i,
.btn-icon i,
.feature-icon i,
.action-btn i {
    color: inherit;
}

.empty-icon i,
.loading-state i {
    color: var(--text);
}

.btn-primary i,
.btn-icon i {
    margin-right: 6px;
}

.btn-primary,
.btn-secondary,
.btn-icon,
.file-item {
    transition: all 0.2s ease;
}

.btn-primary:active,
.btn-secondary:active,
.btn-icon:active {
    transform: scale(0.98);
}

.file-item:active {
    transform: scale(0.995);
}

.shared-container {
    padding: 60px 20px;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.shared-file-card {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
    background: var(--hover);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.shared-file-icon {
    font-size: 80px;
    color: var(--accent);
    margin-bottom: 20px;
}

.shared-file-name {
    font-size: 32px;
    margin-bottom: 20px;
    word-break: break-word;
}

.shared-file-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.shared-meta-item {
    color: var(--text);
    opacity: 0.7;
}

.shared-preview {
    margin: 30px 0;
    min-height: 200px;
}

.preview-image {
    max-width: 100%;
    max-height: 500px;
    border-radius: 8px;
}

.preview-video {
    max-width: 100%;
    max-height: 500px;
    border-radius: 8px;
}

.preview-audio {
    width: 100%;
}

.preview-pdf {
    width: 100%;
    height: 600px;
    border: none;
    border-radius: 8px;
}

.preview-text {
    background: var(--bg);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    text-align: left;
    max-height: 500px;
}

.preview-error {
    opacity: 0.5;
}

.shared-actions {
    margin-top: 30px;
}

.error-card {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    padding: 60px 40px;
}

.error-icon {
    font-size: 80px;
    color: var(--accent);
    margin-bottom: 20px;
    opacity: 0.5;
}

.error-card h2 {
    font-size: 28px;
    margin-bottom: 15px;
}

.error-card p {
    opacity: 0.7;
    margin-bottom: 30px;
}

.shared-skeleton {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
}

.skeleton-icon {
    width: 80px;
    height: 80px;
    background: var(--border);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-title {
    height: 40px;
    background: var(--border);
    border-radius: 8px;
    margin: 0 auto 20px;
    max-width: 400px;
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-text {
    height: 20px;
    background: var(--border);
    border-radius: 8px;
    margin: 0 auto 10px;
    max-width: 300px;
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-text.short {
    max-width: 200px;
}

.skeleton-button {
    height: 50px;
    background: var(--border);
    border-radius: 8px;
    margin: 30px auto 0;
    max-width: 200px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.share-option {
    margin: 20px 0;
    text-align: left;
}

.share-option label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.feature h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.feature p {
    opacity: 0.7;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: var(--modal-bg);
    margin: 10% auto;
    padding: 40px;
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
}

.modal-content.small {
    max-width: 350px;
}

.modal-content.preview {
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
}

#previewContent img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

#previewContent video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

#previewContent audio {
    width: 100%;
    margin: 20px 0;
}

#previewContent pre {
    background: var(--hover);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#previewContent iframe {
    width: 100%;
    height: 600px;
    border: none;
    border-radius: 8px;
}

.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    opacity: 0.7;
}

.modal h2 {
    margin-bottom: 30px;
}

.auth-btn {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-btn:hover {
    background: var(--hover);
}

.auth-btn i {
    margin-right: 8px;
    color: var(--text);
}

.input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 10px;
    margin-top: 10px;
}

.storage-container {
    padding: 40px 0;
}

.storage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.breadcrumb {
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.breadcrumb-item {
    cursor: pointer;
    color: var(--text);
    opacity: 0.6;
}

.breadcrumb-item:hover {
    opacity: 1;
}

.breadcrumb-item.active {
    opacity: 1;
    font-weight: 500;
}

.breadcrumb-item:not(:last-child)::after {
    content: " / ";
    margin: 0 5px;
}

.toolbar {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 20px 0;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border);
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
}

.btn-icon:hover:not(:disabled) {
    background: var(--hover);
}

.btn-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon i {
    color: var(--text);
}

.search-box {
    flex: 1;
}

.select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
}

option {
    background: var(--bg);
    color: var(--text);
}

.file-browser {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 20px;
}

.file-list-header {
    display: grid;
    grid-template-columns: 40px 1fr 120px 150px 120px;
    padding: 15px;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
    background: var(--hover);
    color: var(--text);
}

.file-list {
    min-height: 400px;
}

.file-item {
    display: grid;
    grid-template-columns: 40px 1fr 120px 150px 120px;
    padding: 15px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    cursor: pointer;
}

.file-item:hover {
    background: var(--hover);
}

.file-item.selected {
    background: var(--hover);
}

.file-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-icon {
    font-size: 20px;
}

.file-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    color: var(--text);
}

.action-btn:hover {
    opacity: 0.7;
}

.action-btn i {
    color: var(--text);
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text);
}

.empty-state p {
    opacity: 0.5;
}

.loading-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text);
}

.loading-state p {
    opacity: 0.7;
    margin-top: 20px;
}

.spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.storage-meter {
    background: var(--hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.storage-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.storage-label {
    font-weight: 500;
}

.storage-amount {
    color: var(--accent);
    font-weight: 600;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.user-email {
    font-size: 14px;
    opacity: 0.7;
}

.upload-progress {
    background: var(--hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.3s;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 32px;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .file-list-header,
    .file-item {
        grid-template-columns: 40px 1fr 80px;
    }
    
    .file-col-date,
    .file-col-actions {
        display: none;
    }
}
