
:root {
  --primary-color: #1a73e8;
  --bg-color: #f8f9fa;
  --sidebar-width: 256px;
  --header-height: 64px;
  --border-color: #dadce0;
  --text-color: #3c4043;
  --hover-bg: #f1f3f4;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Montserrat', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #fff;
  color: var(--text-color);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-color);
  background: #fff;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 22px;
  font-weight: 500;
  color: #5f6368;
  width: var(--sidebar-width);
}

.logo span {
  margin-left: 8px;
}

.search-bar {
  flex-grow: 1;
  max-width: 720px;
  margin: 0 20px;
  background: var(--bg-color);
  border-radius: 8px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  transition: background 0.2s, box-shadow 0.2s;
}

.search-bar:focus-within {
  background: #fff;
  box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

.search-bar input {
  border: none;
  background: transparent;
  flex-grow: 1;
  margin-left: 10px;
  font-family: inherit;
  font-size: 16px;
  outline: none;
}

/* Main Layout */
.main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.new-btn {
  display: flex;
  align-items: center;
  width: fit-content;
  padding: 12px 24px 12px 16px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  cursor: pointer;
  transition: box-shadow 0.2s, background 0.2s;
  margin-bottom: 16px;
}

.new-btn:hover {
  box-shadow: 0 4px 8px 3px rgba(60,64,67,0.15);
  background: #f8f9fa;
}

.new-btn span:last-child {
  margin-left: 12px;
  font-weight: 500;
  color: #3c4043;
}

/* Combined Button */
.combined-btn {
  display: flex;
  width: fit-content;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  margin-bottom: 16px;
  overflow: hidden;
}

.btn-half {
  display: flex;
  align-items: center;
  padding: 12px 20px 12px 16px;
  cursor: pointer;
  transition: background 0.2s;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  text-decoration: none;
}

.btn-half:hover {
  background: #f8f9fa;
}

.btn-half span:last-child {
  margin-left: 8px;
  font-weight: 500;
  color: #3c4043;
}

.file-half {
  border-right: 1px solid #dadce0;
}

.file-half:hover {
  background: #e8f5e8;
}

.folder-half:hover {
  background: #fff3e0;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 8px 12px 8px 24px;
  border-radius: 0 24px 24px 0;
  cursor: pointer;
  color: #3c4043;
  margin-bottom: 4px;
}

.nav-item.active {
  background: #e8f0fe;
  color: var(--primary-color);
}

.nav-item:hover:not(.active) {
  background: var(--hover-bg);
}

.nav-item .material-icons-outlined {
  margin-right: 12px;
  font-size: 20px;
}

/* Content Area */
.content {
  flex: 1;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transition: margin-right 0.3s ease;
}

.content.with-panel {
  margin-right: 400px;
}

.breadcrumb {
  font-size: 18px;
  color: #202124;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.breadcrumb-item {
  cursor: pointer;
  color: #1967d2;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.breadcrumb-item:hover {
  background: #e8f0fe;
}

.breadcrumb-item.current {
  color: #202124;
  cursor: default;
}

.breadcrumb-item.current:hover {
  background: none;
}

/* File Grid */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.file-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  position: relative;
}

.file-card:hover {
  background: #e8f0fe;
  border-color: transparent;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.file-card:active {
  transform: scale(0.98);
}

.folder-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  position: relative;
}

.folder-card:hover {
  background: #e8f0fe;
  border-color: transparent;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.folder-card:active {
  transform: scale(0.98);
}

.file-preview {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f3f4;
  border-radius: 4px;
  margin-bottom: 12px;
  color: #5f6368;
  overflow: hidden;
}

.file-preview .material-icons-outlined {
  font-size: 64px;
}

.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.file-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.file-actions {
  opacity: 0;
  transition: opacity 0.2s;
}

.file-card:hover .file-actions {
  opacity: 1;
}

.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  color: #5f6368;
}

.action-btn:hover {
  background: rgba(0,0,0,0.1);
}

/* Upload Input */
input[type="file"] {
  display: none;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #5f6368;
}

.empty-state .material-icons-outlined {
  font-size: 96px;
  color: #dadce0;
  margin-bottom: 20px;
}

/* Right Panel */
.right-panel {
  position: fixed;
  top: var(--header-height);
  right: 0;
  width: 400px;
  height: calc(100vh - var(--header-height));
  background: #fff;
  border-left: 1px solid var(--border-color);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.right-panel.open {
  transform: translateX(0);
}

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-size: 16px;
  font-weight: 500;
  color: #202124;
}

.close-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  color: #5f6368;
}

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

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.file-preview-large {
  width: 100%;
  max-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f3f4;
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
}

.file-preview-large img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.file-preview-large .material-icons-outlined {
  font-size: 96px;
  color: #5f6368;
}

.file-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.detail-label {
  font-weight: 500;
  color: #5f6368;
  font-size: 14px;
}

.detail-value {
  color: #202124;
  font-size: 14px;
}

.panel-actions {
  padding: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
}

.panel-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.panel-btn.download {
  background: var(--primary-color);
  color: white;
}

.panel-btn.delete {
  background: #ea4335;
  color: white;
}

/* Auth Styles */
.google-btn {
  display: flex;
  align-items: center;
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 4px;
  padding: 8px 16px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.google-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

.google-btn img {
  width: 18px;
  height: 18px;
  margin-right: 12px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  margin-bottom: 20px;
}

.auth-input {
  padding: 10px 12px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.auth-input:focus {
  border-color: var(--primary-color);
}

.auth-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.auth-btn:hover {
  background: #1557b0;
}

.auth-separator {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 320px;
  margin: 0 0 20px 0;
  color: #5f6368;
  font-size: 14px;
}

.auth-separator::before,
.auth-separator::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #dadce0;
}

.auth-separator span {
  padding: 0 10px;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.modal-content h3 {
  margin: 0 0 16px 0;
  font-size: 20px;
  font-weight: 500;
}
