/* ======================
   RESET & BASE STYLES 
   ====================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

/* ===============
   CONTAINER 
   =============== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    overflow: hidden;
    position: relative;
    z-index: 10;
}

/* =============
   HEADER 
   ============= */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    font-weight: 800;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

.header p {
    font-size: 1.2rem;
    opacity: 0.95;
    position: relative;
    z-index: 2;
    font-weight: 500;
}

.header .domain-badge {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    padding: 8px 20px;
    display: inline-block;
    margin-top: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

/* ==============
   CONTENT AREA 
   ============== */
.content {
    padding: 40px;
}

/* =================
   NAVIGATION BAR 
   ================= */
.navigation-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.breadcrumb-container {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f8f9ff 0%, #e3e7ff 100%);
    padding: 15px 20px;
    border-radius: 25px;
    border: 2px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.1);
    flex: 1;
    min-width: 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    white-space: nowrap;
}

.breadcrumb-item {
    color: #495057;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.breadcrumb-item:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.breadcrumb-separator {
    color: #6c757d;
    margin: 0 8px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ==========
   BUTTONS 
   ========== */
.nav-btn, .upload-btn, .refresh-btn, .btn {
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

/* Button Variants */
.nav-btn {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.nav-btn:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.upload-btn, .select-files-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

.upload-btn:hover, .select-files-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 147, 251, 0.4);
}

.refresh-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.download-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
    padding: 8px 14px;
    font-size: 0.8rem;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.delete-btn {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 101, 101, 0.3);
    padding: 8px 14px;
    font-size: 0.8rem;
}

.delete-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 101, 101, 0.4);
}

.share-btn {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(66, 153, 225, 0.3);
    padding: 8px 14px;
    font-size: 0.8rem;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 153, 225, 0.4);
}

/* ============
   FILE GRID 
   ============ */
.file-grid {
    display: grid;
    gap: 25px;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
}

.file-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 25px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.file-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
    border-radius: 20px;
    opacity: 0;
    transition: all 0.4s ease;
    z-index: -1;
}

.file-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(102, 126, 234, 0.2),
        0 0 0 1px rgba(102, 126, 234, 0.1) inset;
    border-color: rgba(102, 126, 234, 0.3);
}

.file-item:hover::before {
    opacity: 0.05;
}

.file-item.directory {
    background: linear-gradient(135deg, rgba(255, 248, 220, 0.9) 0%, rgba(255, 239, 213, 0.8) 100%);
}

.file-item.directory:hover {
    border-color: rgba(255, 193, 7, 0.3);
    box-shadow: 
        0 20px 40px rgba(255, 193, 7, 0.2),
        0 0 0 1px rgba(255, 193, 7, 0.1) inset;
}

.file-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    position: relative;
}

.file-item.directory .file-icon-container {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 152, 0, 0.1) 100%);
}

.file-icon {
    font-size: 28px;
    transition: all 0.3s ease;
}

.file-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 15px;
    word-break: break-word;
    line-height: 1.4;
}

.file-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #718096;
    margin-bottom: 20px;
    font-weight: 500;
}

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

/* ================
   LOADING STATES 
   ================ */
.loading {
    text-align: center;
    padding: 80px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(102, 126, 234, 0.1);
    border-left: 4px solid #667eea;
    border-radius: 50%;
    margin: 0 auto 25px;
}

.loading h3 {
    color: #4a5568;
    margin-bottom: 10px;
}

.loading p {
    color: #718096;
}

.error {
    text-align: center;
    padding: 80px;
    color: #e53e3e;
}

.error h3 {
    margin-bottom: 15px;
}

/* ===============
   EMPTY STATES 
   =============== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1/-1;
}

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

.empty-state h3 {
    color: #4a5568;
    margin-bottom: 10px;
}

.empty-state p {
    color: #718096;
}

/* ===================
   UPLOAD COMPONENTS 
   =================== */
.upload-drop-zone {
    border: 3px dashed #cbd5e0;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.05) 0%, rgba(245, 87, 108, 0.05) 100%);
    display: none;
}

.upload-drop-zone.active {
    display: block;
}

.upload-drop-zone.dragover {
    border-color: #f093fb;
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.1) 0%, rgba(245, 87, 108, 0.1) 100%);
    transform: scale(1.02);
}

.upload-drop-zone h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.upload-drop-zone p {
    color: #718096;
    margin-bottom: 20px;
}

.upload-file-input {
    display: none;
}

/* Upload Progress */
.upload-progress {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.upload-progress.active {
    display: block;
}

.upload-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.upload-file-item:last-child {
    border-bottom: none;
}

.upload-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.upload-file-name {
    font-weight: 600;
    color: #2d3748;
}

.upload-file-size {
    color: #718096;
    font-size: 0.85rem;
}

.upload-progress-bar {
    flex: 1;
    margin: 0 15px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

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

.upload-status {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    white-space: nowrap;
}

.upload-status.uploading {
    background: #fed7d7;
    color: #c53030;
}

.upload-status.completed {
    background: #c6f6d5;
    color: #22543d;
}

.upload-status.failed {
    background: #fed7d7;
    color: #c53030;
}

/* ==========
   MODALS 
   ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 35px;
    border-radius: 25px;
    width: 90%;
    max-width: 600px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    position: relative;
    transform: scale(0.9);
}

.modal h3 {
    margin-bottom: 25px;
    color: #2d3748;
    font-size: 1.4rem;
    font-weight: 700;
}

.modal input, .modal textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-family: 'Monaco', 'Menlo', monospace;
    transition: border-color 0.3s ease;
    background: #f7fafc;
}

.modal input:focus, .modal textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal textarea {
    height: 120px;
    resize: vertical;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
}

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.modal-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.modal-btn.danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 101, 101, 0.3);
}

.modal-btn.secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.modal-btn:hover {
    transform: translateY(-2px);
}

.success-message {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    color: #22543d;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    border: 1px solid #9ae6b4;
}

.code-block {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    color: #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    overflow-x: auto;
    margin: 15px 0;
    border: 1px solid #4a5568;
}