/* ============================================
   Company Drive Portal — Stylesheet
   Primary color: #0F62FE | White background
   ============================================ */

/* --- CSS Variables --- */
:root {
  --primary: #0F62FE;
  --primary-hover: #0353E9;
  --primary-light: rgba(15, 98, 254, 0.08);
  --white: #ffffff;
  --bg: #ffffff;
  --text: #161616;
  --text-muted: #525252;
  --border: #e0e0e0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 24px rgba(15, 98, 254, 0.15);
  --radius: 16px;
  --transition: 0.25s ease;
  --max-width: 1200px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Header --- */
.header {
  text-align: center;
  padding: 2.5rem 1.5rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
  min-height: 72px;
}

.logo {
  max-height: 72px;
  max-width: 240px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.logo-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  min-height: 72px;
  padding: 1rem 2rem;
  background: var(--primary-light);
  border: 2px dashed var(--primary);
  border-radius: var(--radius);
  color: var(--primary);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.page-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
}

/* --- Main Content --- */
.main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  width: 100%;
}

/* --- Search Box --- */
.search-wrapper {
  margin-bottom: 2rem;
}

.search-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1rem;
  width: 20px;
  height: 20px;
  fill: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-input::placeholder {
  color: #a8a8a8;
}

/* --- Card Grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

/* --- Individual Card --- */
.card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  aspect-ratio: 1 / 1;
  min-height: 0;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(15, 98, 254, 0.25);
}

.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.card-icon svg {
  width: 100%;
  height: 100%;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.card-description {
  font-size: 0.875rem;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 1rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* --- Open Folder Button --- */
.btn-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
  background-color: var(--primary);
  border: none;
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
  transition: background-color var(--transition), transform var(--transition);
  margin-top: auto;
}

.btn-open:hover {
  background-color: var(--primary-hover);
}

.btn-open:active {
  transform: scale(0.98);
}

.btn-open svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 1rem;
}

/* --- Footer --- */
.footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--white);
}

.footer p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* --- Responsive Breakpoints --- */

/* Tablet */
@media (max-width: 768px) {
  .header {
    padding: 2rem 1.25rem 1.25rem;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
  }

  .card {
    padding: 1.25rem;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .header {
    padding: 1.5rem 1rem 1rem;
  }

  .main {
    padding: 0 1rem 2rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card {
    aspect-ratio: auto;
    min-height: 220px;
  }

  .logo-placeholder {
    min-width: 140px;
    font-size: 0.9rem;
  }
}
