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

body {
    min-height: 100vh;
    background: #0a0a0a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #f4f4ff;
    overflow-x: hidden;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.loading-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #a855f7 50%, #6366f1 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.loading-text {
    color: #c1c1d8;
    font-size: 1.1rem;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid #2a2a2a;
    border-top: 2px solid #a855f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* CDN Icon */
.cdn-icon {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cdn-icon.small {
    width: 32px;
    height: 32px;
}

.cdn-icon:not(.small):not(.large) {
    width: 80px;
    height: 80px;
}

.cdn-icon.large {
    width: 120px;
    height: 120px;
}

.cdn-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    position: relative;
    box-shadow: 0 8px 32px rgba(168, 85, 247, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightning-bolt {
    position: absolute;
    width: 50%;
    height: 50%;
    background: #ffd700;
    clip-path: polygon(30% 0%, 70% 0%, 40% 50%, 80% 50%, 50% 100%, 20% 50%, 60% 50%);
    animation: pulse 2s ease-in-out infinite;
}

.cdn-icon.small .lightning-bolt {
    width: 60%;
    height: 60%;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* Auth Gate */
.auth-gate {
    min-height: 100vh;
    background: radial-gradient(circle at top, #121520 0%, #0a0a0a 60%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.auth-container {
    max-width: 480px;
    width: 100%;
    text-align: center;
}

.auth-hero {
    margin-bottom: 48px;
}

.auth-title {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #a855f7 50%, #6366f1 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    margin: 24px 0 12px;
}

.auth-tagline {
    font-size: 1.3rem;
    color: #c1c1d8;
    margin-bottom: 8px;
}

.auth-description {
    color: #8b8ba0;
    font-size: 1rem;
}

.google-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px 32px;
    background: #fff;
    color: #1f2937;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.google-signin-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.google-icon {
    width: 20px;
    height: 20px;
}

/* Main App */
.main-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: rgba(26, 26, 26, 0.8);
    border-bottom: 1px solid #2a2a2a;
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #a855f7 50%, #6366f1 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-email {
    color: #c1c1d8;
    font-size: 0.9rem;
}

.sign-out-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #c1c1d8;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sign-out-btn:hover {
    border-color: #a855f7;
    color: #a855f7;
}

/* Dashboard */
.dashboard {
    flex: 1;
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 100%);
    padding: 40px 24px;
}

.dashboard-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #fff 0%, #a855f7 50%, #6366f1 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Upload Section */
.upload-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 32px;
    position: relative;
}

.upload-zone {
    border: 2px dashed #3a3a3a;
    border-radius: 12px;
    padding: 48px 32px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.upload-zone:hover {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.05);
}

.upload-zone.dragging {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.7;
}

.upload-zone h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #f8f8ff;
}

.upload-zone p {
    color: #8b8ba0;
    margin-bottom: 4px;
}

.upload-note {
    font-size: 0.85rem !important;
    color: #6366f1 !important;
    font-weight: 500;
}

.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-btn {
    margin-top: 16px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.4);
}

.upload-progress {
    position: absolute;
    inset: 0;
    background: #1a1a1a;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.progress-bar {
    width: 70%;
    height: 8px;
    background: #2a2a2a;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    color: #c1c1d8;
    font-weight: 600;
}

/* Storage Section */
.storage-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: center;
}

.storage-stats {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.9rem;
    color: #8b8ba0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #f8f8ff;
}

.storage-meter {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.meter-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f8f8ff;
}

.meter-bar {
    width: 100%;
    height: 12px;
    background: #2a2a2a;
    border-radius: 6px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    width: 0%;
    transition: width 0.6s ease;
}

.meter-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #c1c1d8;
}

/* Assets Section */
.assets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.view-controls {
    display: flex;
    gap: 8px;
}

.view-btn {
    padding: 8px 12px;
    background: transparent;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #8b8ba0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn:hover {
    border-color: #3a3a3a;
    color: #c1c1d8;
}

.view-btn.active {
    border-color: #a855f7;
    color: #a855f7;
    background: rgba(168, 85, 247, 0.1);
}

.search-controls {
    display: flex;
    gap: 12px;
}

.search-input {
    padding: 8px 12px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #f8f8ff;
    font-size: 0.9rem;
    min-width: 200px;
}

.search-input:focus {
    outline: none;
    border-color: #a855f7;
}

.filter-select {
    padding: 8px 12px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #f8f8ff;
    font-size: 0.9rem;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: #a855f7;
}

.assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    min-height: 200px;
}

.assets-grid.list-view {
    grid-template-columns: 1fr;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 64px 32px;
    color: #8b8ba0;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #c1c1d8;
}

.asset-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
}

.asset-card:hover {
    border-color: #3a3a3a;
    transform: translateY(-2px);
}

.asset-preview {
    width: 100%;
    height: 160px;
    background: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.asset-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.asset-type-icon {
    font-size: 3rem;
    opacity: 0.6;
}

.asset-info {
    padding: 16px;
}

.asset-name {
    font-weight: 600;
    color: #f8f8ff;
    margin-bottom: 4px;
    font-size: 0.9rem;
    word-break: break-all;
}

.asset-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #8b8ba0;
    margin-bottom: 12px;
}

.asset-actions {
    display: flex;
    gap: 8px;
}

.asset-action-btn {
    padding: 6px 12px;
    background: #2a2a2a;
    border: none;
    border-radius: 6px;
    color: #c1c1d8;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.asset-action-btn:hover {
    background: #3a3a3a;
}

.asset-action-btn.primary {
    background: linear-gradient(135deg, #a855f7, #6366f1);
    color: #fff;
}

.asset-action-btn.danger {
    background: #dc2626;
    color: #fff;
}

/* List view styles */
.assets-grid.list-view .asset-card {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 16px;
}

.assets-grid.list-view .asset-preview {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.assets-grid.list-view .asset-info {
    flex: 1;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.assets-grid.list-view .asset-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.assets-grid.list-view .asset-actions {
    flex-shrink: 0;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    min-width: 300px;
    padding: 16px 20px;
    border-radius: 12px;
    color: #fff;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    animation: slideIn 0.3s ease forwards;
    backdrop-filter: blur(16px);
}

.toast.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.toast.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.toast.info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

@keyframes slideIn {
    to {
        transform: translateX(0);
    }
}

@keyframes slideOut {
    to {
        transform: translateX(100%);
    }
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(8px);
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-content {
    max-width: 800px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #f8f8ff;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: #8b8ba0;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

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

.preview-body {
    padding: 24px;
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.preview-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.preview-body pre {
    background: #0a0a0a;
    border-radius: 8px;
    padding: 16px;
    overflow: auto;
    color: #c1c1d8;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    max-width: 100%;
}

.modal-actions {
    padding: 20px 24px;
    border-top: 1px solid #2a2a2a;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.action-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.action-btn.primary {
    background: linear-gradient(135deg, #a855f7, #6366f1);
    color: #fff;
}

.action-btn.danger {
    background: #dc2626;
    color: #fff;
}

.action-btn:hover {
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard {
        padding: 24px 16px;
    }
    
    .dashboard-content {
        gap: 32px;
    }
    
    .storage-card {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .assets-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-controls {
        flex-direction: column;
    }
    
    .search-input {
        min-width: auto;
    }
    
    .header-content {
        padding: 12px 16px;
    }
    
    .user-info {
        gap: 12px;
    }
    
    .user-email {
        display: none;
    }
    
    .auth-title {
        font-size: 2.5rem;
    }
    
    .toast-container {
        right: 16px;
        left: 16px;
    }
    
    .toast {
        min-width: auto;
    }
    
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .modal-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .assets-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .auth-title {
        font-size: 2rem;
    }
    
    .upload-zone {
        padding: 32px 16px;
    }
    
    .upload-zone h3 {
        font-size: 1.1rem;
    }
    
    .view-controls {
        justify-content: center;
    }
}

/* Storage Breath Meter */
.breath-meter {
    margin-top: 24px;
    text-align: center;
}

.breath-visualization {
    margin: 16px 0;
    display: flex;
    justify-content: center;
}

.breath-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    background: radial-gradient(circle, rgba(106, 102, 255, 0.1) 0%, transparent 70%);
}

.breath-circle.inhaling {
    transform: scale(1.1);
    border-color: #10b981;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.breath-circle.exhaling {
    transform: scale(0.9);
    border-color: #f59e0b;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, transparent 70%);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.breath-center {
    text-align: center;
}

.breath-center span {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    color: #f4f4ff;
}

.breath-center small {
    color: #8b8ba0;
    font-size: 0.8rem;
    margin-top: 4px;
}

.breath-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 16px;
}

.breath-stat {
    text-align: center;
}

.breath-stat span:first-child {
    display: block;
    color: #8b8ba0;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.breath-stat span:last-child {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: #f4f4ff;
}

/* Auto-Expire Section */
.auto-expire-section {
    margin-top: 24px;
    padding: 16px;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
}

.auto-expire-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.toggle-label {
    color: #f4f4ff;
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2a2a2a;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #8b8ba0;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-input:checked + .toggle-slider {
    background-color: #6366f1;
}

.toggle-input:checked + .toggle-slider:before {
    transform: translateX(26px);
    background-color: white;
}

.auto-expire-settings {
    display: flex;
    align-items: center;
    gap: 12px;
}

.expire-label {
    color: #8b8ba0;
    font-size: 0.9rem;
}

.expire-select {
    background: #2a2a2a;
    color: #f4f4ff;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.9rem;
}