/* ============================================================
   1. Core Aesthetics & MAXIMUM ICE THEME
   ============================================================ */
:root {
    --bg-start: #b2ebf2; --bg-mid: #4dd0e1; --bg-end: #0097a7;
    --text-main: #00363a; --text-secondary: #005662;
    --highlight: #b2ebf2; --btn-bg: rgba(255, 255, 255, 0.3); --btn-hover: rgba(255, 255, 255, 0.6);
    --progress-fill: #18ffff; --ice-highlight: rgba(255, 255, 255, 0.85);
    --ice-dim: rgba(255, 255, 255, 0.1); --ice-shadow: rgba(0, 50, 80, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; }

body { background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-mid) 40%, var(--bg-end) 100%); background-attachment: fixed; min-height: 100vh; color: var(--text-main); overflow-x: hidden; position: relative; padding-bottom: 80px; }
body::before { content: ''; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.4) 0%, transparent 40%), radial-gradient(circle at 80% 70%, rgba(255,255,255,0.3) 0%, transparent 50%); pointer-events: none; z-index: -2; }

#bg-particles { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.icon-particle { position: absolute; fill: rgba(255, 255, 255, 0.5); animation: floatParticle 40s infinite linear; filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8)); }
@keyframes floatParticle { 0% { transform: translate(0, 10vh) rotate(0deg); opacity: 0; } 10% { opacity: 0.8; } 90% { opacity: 0.8; } 100% { transform: translate(30vw, -110vh) rotate(360deg); opacity: 0; } }
.icon-particle:nth-child(odd) { animation-duration: 60s; fill: rgba(255, 255, 255, 0.3); }
.icon-particle:nth-child(3n) { animation-delay: -15s; scale: 1.2; }
.icon-particle:nth-child(5n) { animation-delay: -30s; scale: 0.7; }

.card { background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(30px); border-radius: 24px; border: 1px solid var(--ice-dim); border-top: 2px solid var(--ice-highlight); border-left: 2px solid var(--ice-highlight); box-shadow: 0 20px 50px var(--ice-shadow), inset 0 0 20px rgba(255, 255, 255, 0.5); padding: 30px; transition: height 0.4s ease, transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease; position: relative; overflow: hidden; }
.card:hover { background: rgba(255, 255, 255, 0.22); box-shadow: 0 25px 60px var(--ice-shadow), inset 0 0 30px rgba(255, 255, 255, 0.7); }

#app-container { max-width: 1100px; margin: 40px auto 60px auto; display: flex; flex-direction: column; gap: 40px; z-index: 10; position: relative; transition: max-width 0.4s cubic-bezier(0.25, 1, 0.5, 1); }

#auth-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; margin-top: 10vh; gap: 20px; text-align: center; padding: 50px 60px; min-width: 450px; max-width: 550px; margin-left: auto; margin-right: auto; }

.driveforge-logo { width: 140px; height: auto; margin-top: 15px; margin-bottom: 25px; filter: drop-shadow(0 15px 20px rgba(0, 50, 80, 0.4)); transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.driveforge-logo:hover { transform: scale(1.08) rotate(-3deg); }

#main-app { display: none; }

#header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding: 0 10px; }
#logo-title { display: flex; align-items: center; gap: 15px; text-decoration: none; color: inherit; }
.header-logo { width: 50px; height: auto; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2)); }
#app-title { font-size: 2.2rem; font-weight: 800; color: #ffffff; text-shadow: 0 2px 10px rgba(0, 151, 167, 0.8); letter-spacing: 1px; }
#user-controls { display: flex; align-items: center; gap: 20px; }

.glass-button { background: var(--btn-bg); border: 1px solid var(--ice-highlight); padding: 12px 24px; border-radius: 30px; color: var(--text-main); font-weight: 700; cursor: pointer; backdrop-filter: blur(10px); box-shadow: 0 4px 15px rgba(0,0,0,0.1), inset 0 2px 4px rgba(255,255,255,0.6); transition: all 0.2s ease; text-transform: uppercase; letter-spacing: 0.5px; }
.glass-button:hover { background: var(--btn-hover); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.15), inset 0 2px 8px rgba(255,255,255,0.8); }
.glass-button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

#time-status { display: flex; gap: 20px; color: #ffffff; font-size: 0.95rem; font-weight: 700; text-transform: uppercase; background: rgba(0, 0, 0, 0.1); padding: 8px 16px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.2); backdrop-filter: blur(5px); }
.timer-block { display: flex; align-items: center; gap: 8px; }

.step-title { font-size: 1.4rem; font-weight: 800; color: var(--text-main); margin-bottom: 20px; display: flex; align-items: center; gap: 12px; text-shadow: 0 1px 2px rgba(255,255,255,0.5); }
.step-number { background: rgba(255,255,255,0.9); color: var(--text-secondary); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 900; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); }

#drive-explorer-card { display: flex; flex-direction: column; height: 550px; min-height: 550px; margin-bottom: 20px; gap: 15px; transition: height 0.4s cubic-bezier(0.25, 1, 0.5, 1); }

#explorer-top-bar { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 5px; flex-wrap: wrap; }
#breadcrumb { flex-grow: 1; display: flex; gap: 8px; font-size: 1rem; font-weight: 700; color: var(--text-main); padding: 12px 15px; background: rgba(255,255,255,0.2); border-radius: 12px; border: 1px solid rgba(255,255,255,0.4); box-shadow: inset 0 2px 4px rgba(0,0,0,0.05); min-width: 200px; }
.breadcrumb-item { cursor: pointer; transition: color 0.2s; }
.breadcrumb-item:hover { color: #ffffff; text-shadow: 0 0 5px rgba(255,255,255,0.8); }
.breadcrumb-separator { opacity: 0.5; }

select, input[type="text"] { padding: 12px 15px; border-radius: 12px; border: 1px solid var(--ice-dim); border-top: 1px solid var(--ice-highlight); border-left: 1px solid var(--ice-highlight); background: rgba(255, 255, 255, 0.4); backdrop-filter: blur(10px); color: var(--text-main); font-size: 1rem; font-weight: 700; box-shadow: inset 0 2px 5px rgba(0,0,0,0.05); transition: all 0.2s ease; cursor: pointer; outline: none;}
select:hover, input[type="text"]:hover, select:focus, input[type="text"]:focus { background: rgba(255, 255, 255, 0.7); box-shadow: inset 0 2px 5px rgba(0,0,0,0.05), 0 0 15px rgba(255,255,255,0.6); }

.mode-selector { background: rgba(24, 255, 255, 0.2); border-color: #18ffff; color: #004d40; text-transform: uppercase; font-weight: 900; }
.mode-selector:hover { background: rgba(24, 255, 255, 0.4); }

#file-list-header { display: grid; grid-template-columns: 80px 1fr 120px 120px; gap: 15px; padding: 10px 15px; font-size: 0.9rem; text-transform: uppercase; font-weight: 800; color: var(--text-secondary); border-bottom: 2px solid rgba(255,255,255,0.3); margin-bottom: 10px; align-items: center; }
#file-list { flex-grow: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 5px; min-height: 250px; }
#file-list::-webkit-scrollbar, #review-list::-webkit-scrollbar, #logArea::-webkit-scrollbar { width: 8px; }
#file-list::-webkit-scrollbar-track, #review-list::-webkit-scrollbar-track, #logArea::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }
#file-list::-webkit-scrollbar-thumb, #review-list::-webkit-scrollbar-thumb, #logArea::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.5); border-radius: 10px; border: 1px solid rgba(255,255,255,0.8); }

.file-item { display: grid; grid-template-columns: 80px 1fr 120px 120px; gap: 15px; align-items: center; padding: 10px 15px; border-radius: 12px; cursor: pointer; transition: all 0.2s; color: var(--text-main); font-weight: 600; font-size: 1rem; background: rgba(255,255,255,0.1); border: 1px solid transparent; }
.file-item:hover { background: rgba(255, 255, 255, 0.4); border: 1px solid var(--ice-highlight); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.file-item.selected { background: rgba(24, 255, 255, 0.25); border: 1px solid #18ffff; box-shadow: 0 0 15px rgba(24, 255, 255, 0.3), inset 0 0 10px rgba(255,255,255,0.5); }
.checkbox-container { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.file-checkbox, #select-all-checkbox { width: 22px; height: 22px; cursor: pointer; accent-color: #00838f; margin: 0; }
.file-name-block { display: flex; align-items: center; gap: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.file-icon { width: 26px; height: 26px; fill: var(--text-secondary); flex-shrink: 0; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.1)); }
.file-item[data-type="folder"] .file-icon { fill: #fbc02d; } 
.file-size, .file-type { font-weight: 500; color: var(--text-secondary); text-align: right; pointer-events: none; }

.grid-view-header-hide { display: none !important; }
#file-list.grid-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; align-items: start; padding-right: 5px; }
#file-list.grid-view .file-item { display: flex; flex-direction: column; justify-content: center; align-items: center; height: 160px; padding: 15px; position: relative; text-align: center; }
#file-list.grid-view .checkbox-container { position: absolute; top: 10px; left: 10px; width: auto; height: auto; }
#file-list.grid-view .preview-btn { position: absolute; top: 10px; right: 10px; margin: 0; }
#file-list.grid-view .delete-btn { position: absolute; top: 10px; right: 35px; margin: 0; }
#file-list.grid-view .file-name-block { flex-direction: column; align-items: center; gap: 8px; width: 100%; white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-align: center; margin-top: 5px; }
#file-list.grid-view .file-icon { width: 45px; height: 45px; margin: 0; }
#file-list.grid-view .local-badge { position: absolute; bottom: 10px; left: 10px; margin: 0; }
#file-list.grid-view .file-size { position: absolute; bottom: 10px; right: 10px; font-size: 0.75rem; font-weight: 800; opacity: 0.8; text-align: right; }
#file-list.grid-view .file-type { display: none; }

.preview-btn, .delete-btn { cursor: pointer; margin-left: 10px; font-size: 1.2rem; display: inline-block; transform: scaleY(0.1); opacity: 0.5; transition: transform 0.25s ease, opacity 0.25s ease; }
.preview-btn:hover { transform: scaleY(1); opacity: 1; }
.delete-btn:hover { transform: scaleY(1); opacity: 1; text-shadow: 0 0 5px #ff4d4d; }

.local-badge { background: rgba(255,255,255,0.6); border: 1px solid var(--ice-highlight); color: var(--text-main); font-size: 0.7rem; font-weight: 800; padding: 2px 6px; border-radius: 6px; margin-right: 8px; }

#settings-area { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; transition: opacity 0.3s ease; margin-bottom: 30px; }
.input-group { margin-bottom: 18px; display: flex; flex-direction: column; gap: 10px; }
label { font-weight: 800; color: var(--text-main); font-size: 0.95rem; text-shadow: 0 1px 2px rgba(255,255,255,0.6); }

#logArea { display: flex; flex-direction: column; gap: 8px; min-height: 90px; max-height: 180px; overflow-y: auto; padding: 10px; margin-top: 20px; border-top: 1px solid rgba(255,255,255,0.3); }
.activity-item { display: grid; grid-template-columns: 10px 1fr auto; gap: 11px; align-items: center; padding: 10px; background: rgba(0,0,0,0.15); border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; font: 13px/1.4 'Segoe UI', sans-serif; animation: rise .25s ease-out both; color: var(--text-main); font-weight: 600; }
.activity-item::before { content: ''; width: 8px; height: 8px; background: #18ffff; border-radius: 50%; box-shadow: 0 0 8px #18ffff; }
.activity-item.error { background: rgba(255, 50, 50, 0.15); border-color: rgba(255, 50, 50, 0.4); }
.activity-item.error::before { background: #ff4d4d; box-shadow: 0 0 8px #ff4d4d; }
.activity-item.success::before { background: #00e676; box-shadow: 0 0 8px #00e676; }
.activity-time { color: var(--text-secondary); font-size: 11px; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

#progress-card { text-align: center; display: none; background: rgba(255,255,255,0.25); margin-top: 50px; margin-bottom: 40px; box-shadow: 0 15px 40px rgba(0,0,0,0.2); clear: both; }
#progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding: 0 5px;}
#progress-status-text { font-weight: 800; font-size: 1.1rem; color: var(--text-main); }
#progress-percent-text { font-weight: 900; color: #ffffff; font-size: 1.4rem; text-shadow: 0 0 10px rgba(0, 151, 167, 0.8); }

#progress-bar-container { width: 100%; height: 32px; background: rgba(0,0,0,0.1); border-radius: 20px; overflow: hidden; margin-bottom: 5px; box-shadow: inset 0 3px 8px rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.3); }
#progress-bar-fill { width: 0%; height: 100%; background: linear-gradient(90deg, #b2ebf2, var(--progress-fill)); border-radius: 20px; transition: width 0.3s ease-out; position: relative; box-shadow: 0 0 15px var(--progress-fill); }

#finish-actions { display: none; margin-top: 25px; }

.remove-file-btn { transition: transform 0.2s, text-shadow 0.2s; }
.remove-file-btn:hover { transform: scale(1.3); text-shadow: 0 0 5px #ff4d4d; }

/* Unified Modal Styles */
#preview-modal, #confirm-modal, #create-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 20, 30, 0.6); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); z-index: 999; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.3s ease; }
#preview-modal.show, #confirm-modal.show, #create-modal.show { display: flex; opacity: 1; }

/* Floating Toast System for Cloud Actions Feedback */
#toast-container { position: fixed; bottom: 25px; right: 25px; z-index: 9999; display: flex; flex-direction: column; gap: 12px; pointer-events: none; }
.toast { background: rgba(0, 56, 70, 0.95); backdrop-filter: blur(10px); color: #18ffff; padding: 14px 22px; border-radius: 12px; border: 1px solid #18ffff; font-weight: 700; box-shadow: 0 10px 25px rgba(0,0,0,0.4); animation: slideIn 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards; font-size: 0.95rem; }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

@media (max-width: 768px) {
    #app-container { margin: 20px 10px 40px 10px; }
    .card { padding: 20px; border-radius: 18px; }
    #header { flex-direction: column; align-items: stretch; gap: 15px; }
    #logo-title { justify-content: center; }
    #user-controls { flex-direction: column; width: 100%; gap: 10px; }
    .mode-selector, #time-status, #signout-button { width: 100%; justify-content: center; }
    
    #file-list-header { grid-template-columns: 50px 1fr; }
    #file-list-header > div:nth-child(3), #file-list-header > div:nth-child(4) { display: none; }
    
    .file-item { grid-template-columns: 50px 1fr; padding: 10px; }
    .file-size, .file-type { display: none; }
    
    #settings-area { grid-template-columns: 1fr; }
    #compression-fields > div { grid-template-columns: 1fr !important; }
    
    #auth-screen { min-width: 90%; padding: 30px; }
    #auth-screen h1 { font-size: 2.5rem; }
    .step-title { font-size: 1.2rem; }
    
    .preview-btn, .delete-btn { transform: scaleY(1); opacity: 1; }
}
