:root { 
  /* --- BARVE --- */
  --primary: rgb(226, 0, 26);
  --primary-hover: rgb(180, 0, 20);
  --header-bg: rgb(50, 51, 56);
  
  --gray: #6b7280; 
  --bg-color: #f9fafb;
  --card-bg: #ffffff;
  --border: #e5e7eb;
  --success: #059669;
  --error: #dc2626;
  --new-badge: #0284c7;
  --fav-color: #fbbf24;
  
  /* Sistemska oznaka */
  --system-badge-bg: #f3f4f6; 
  --system-badge-text: #374151;
  --system-badge-border: #d1d5db;
}

body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; max-width: 1000px; margin: 0 auto; padding: 0 20px; padding-top: 120px; color: #1f2937; line-height: 1.6; background-color: var(--bg-color); min-height: 100vh; display: flex; flex-direction: column; }

.fixed-header { position: fixed; top: 0; left: 0; width: 100%; height: 90px; background-color: var(--header-bg); box-shadow: 0 4px 20px rgba(0,0,0,0.2); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.header-content { width: 100%; max-width: 1000px; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }
.logo { height: 45px; width: auto; display: block; cursor: pointer; transition: opacity 0.2s; } .logo:hover { opacity: 0.8; }
.header-text h1 { color: #fff; margin: 0; font-size: 20px; font-weight: 600; letter-spacing: 0.5px; }
.header-text .subtitle { color: #9ca3af; font-size: 13px; margin: 0; font-weight: 400; }

.card { border: 1px solid var(--border); border-radius: 16px; padding: 40px; background: var(--card-bg); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05); }
.input-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 14px; color: #374151; }
input { width: 100%; padding: 14px; border: 1px solid #d1d5db; border-radius: 8px; box-sizing: border-box; font-size: 16px; }
input:focus { outline: none; border-color: var(--primary); ring: 2px solid rgba(226, 0, 26, 0.1); }

button { width: 100%; padding: 14px; border-radius: 8px; border: none; cursor: pointer; font-weight: 600; font-size: 16px; transition: all 0.2s; }
button.primary { background: var(--primary); color: #fff; }
button.primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
button.primary:disabled { opacity: 0.7; cursor: wait; }
button.secondary { background: #fff; border: 1px solid #d1d5db; color: #374151; margin-top: 12px; }
button.secondary:hover { background: #f3f4f6; }
button.ghost { background: transparent; color: #fff; width: auto; padding: 8px 16px; font-size: 14px; border: 1px solid rgba(255,255,255,0.2); border-radius: 6px; }
button.ghost:hover { background: rgba(255,255,255,0.1); border-color: #fff; }

.toolbar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.search-box { flex-grow: 1; }
.view-toggles { display: flex; border: 1px solid #d1d5db; border-radius: 8px; overflow: hidden; }
.view-btn { background: #fff; border: none; padding: 10px 15px; cursor: pointer; border-right: 1px solid #d1d5db; font-size: 18px; display: flex; align-items: center; justify-content: center; width: 44px; }
.view-btn:last-child { border-right: none; }
.view-btn.active { background: #f3f4f6; color: var(--primary); }

.breadcrumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; font-size: 14px; color: var(--gray); flex-wrap: wrap; }
.breadcrumb-item { cursor: pointer; color: var(--primary); font-weight: 600; }
.breadcrumb-item:hover { text-decoration: underline; }

.section-title { font-size: 14px; font-weight: 700; color: var(--gray); text-transform: uppercase; letter-spacing: 1px; margin-top: 35px; margin-bottom: 15px; padding-bottom: 8px; border-bottom: 1px solid #eee; display:flex; align-items:center; gap:8px; }
.section-title.fav { color: #d97706; border-bottom-color: #fcd34d; margin-top: 0; }

.file-container.grid-view { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 768px) { .file-container.grid-view { grid-template-columns: 1fr; } .header-text { display: none; } }
.file-container.grid-view .item { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: inherit; background: #fff; transition: all 0.2s; cursor: pointer; overflow: hidden; height: 100%; position: relative; }
.file-container.grid-view .item:hover { border-color: var(--primary); box-shadow: 0 8px 20px rgba(0,0,0,0.1); transform: translateY(-3px); }
.file-container.grid-view .item-preview { width: 100%; height: 180px; background-color: #f3f4f6; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--border); position: relative; overflow: hidden; }
.file-container.grid-view .item-info { padding: 15px; text-align: center; }
.file-container.grid-view .big-icon { font-size: 64px; }
.icon-img { width: 64px; height: 64px; object-fit: contain; }

.file-container.list-view { display: flex; flex-direction: column; gap: 10px; }
.file-container.list-view .item { display: flex; flex-direction: row; align-items: center; padding: 15px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: #fff; transition: all 0.1s; position: relative; }
.file-container.list-view .item:hover { border-color: var(--primary); background: #fcfcfc; }
.file-container.list-view .item-preview { width: 50px; height: 50px; border-radius: 6px; margin-right: 15px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 24px; border: none; }
.file-container.list-view .item-info { text-align: left; flex-grow: 1; padding: 0; }
.file-container.list-view .item-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.file-container.list-view .icon-img { width: 32px; height: 32px; }

.item-preview img { width: 100%; height: 100%; object-fit: cover; }
.item-preview.folder-bg { background-color: #fff7ed; color: #f97316; }
.item-preview.file-bg { background-color: #f1f5f9; color: #64748b; }
.item-info strong { display: block; color: #111; margin-bottom: 2px; word-break: break-word; font-size: 15px; } 
.item-info small { color: var(--gray); font-size: 13px; display: block; }
.item-date { font-size: 11px; color: #9ca3af; display: block; margin-top: 2px; }

#globalFavorites { margin-bottom: 40px; }
#globalFavorites .item-preview { height: 120px; background: #fffbeb; } 
#globalFavorites .big-icon { font-size: 48px; }

/* --- BADGES --- */
.new-badge { 
  position: absolute; 
  top: 10px; right: 10px; 
  background: var(--new-badge); color: white; 
  font-size: 10px; font-weight: bold; padding: 2px 8px; border-radius: 12px; 
  box-shadow: 0 2px 4px rgba(0,0,0,0.2); z-index: 10; 
  display: none; 
}

.system-badge { 
  position: absolute; 
  right: 10px; 
  background: var(--system-badge-bg); 
  color: var(--system-badge-text); 
  border: 1px solid var(--system-badge-border);
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 12px; 
  z-index: 9; text-transform: uppercase; 
  top: 10px; transition: top 0.3s;
}
.file-container.list-view .new-badge { position: static; margin-left: 10px; }
.file-container.list-view .system-badge { position: static; margin-left: 10px; padding: 2px 6px; }

.fav-btn { position: absolute; top: 10px; left: 10px; background: rgba(255,255,255,0.9); border: 1px solid #ddd; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 20; color: #ccc; font-size: 18px; transition: all 0.2s; }
.fav-btn:hover { transform: scale(1.1); color: var(--fav-color); border-color: var(--fav-color); }
.fav-btn.active { color: var(--fav-color); border-color: var(--fav-color); background: #fffbeb; }
.file-container.list-view .fav-btn { position: static; margin-right: 15px; background: transparent; border: none; width: auto; height: auto; }

.skeleton-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top:20px; }
@media (max-width: 768px) { .skeleton-container { grid-template-columns: 1fr; } }
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: loading 1.5s infinite; border-radius: 8px; }
@keyframes loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.sk-card { height: 200px; border: 1px solid #eee; border-radius: 12px; }

.updates-banner { background: #f0f9ff; border: 1px solid #bae6fd; border-left: 4px solid #0284c7; padding: 15px; border-radius: 8px; margin-bottom: 25px; font-size: 14px; display: none; }
.updates-title { font-weight: 700; color: #075985; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.updates-list { margin: 0; padding-left: 20px; color: #334155; margin-bottom: 10px; }
.show-more-btn { background: transparent; color: #0284c7; border: none; cursor: pointer; font-size: 13px; font-weight: 600; padding: 0; text-align: left; }
.show-more-btn:hover { text-decoration: underline; }

#pdfModal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 2000; flex-direction: column; }
.viewer-toolbar { height: 60px; background: #111; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; color: white; }
.viewer-title { font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 50%; }
.viewer-iframe { width: 100%; flex-grow: 1; border: none; background: #eee; }
.btn-viewer { background: #333; color: white; border: 1px solid #555; padding: 8px 16px; border-radius: 6px; cursor: pointer; text-decoration: none; font-size: 14px; margin-left: 10px; }
.btn-viewer:hover { background: #555; }
.btn-viewer.primary { background: var(--primary); border-color: var(--primary); }

.footer { text-align: center; padding: 30px 20px; color: #9ca3af; font-size: 13px; margin-top: auto; border-top: 1px solid #e5e7eb; }
.footer a { color: #6b7280; text-decoration: none; font-weight: 500; }
.footer a:hover { text-decoration: underline; color: var(--primary); }

#authMsg { margin-top: 15px; text-align: center; font-size: 14px; font-weight: 500; }
.error-msg { color: var(--error); }
.success-msg { color: var(--success); }
.info-box { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 16px; margin-bottom: 24px; color: #166534; font-size: 14px; }
.contact-section { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border); text-align: center; }
.contact-text { font-size: 14px; color: var(--gray); margin-bottom: 12px; }