:root {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: dark;
  color: #e2e8f0;
  background-color: #0f172a;

  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.5);
  --secondary: #8b5cf6;
  --bg-dark: #020617;
  --bg-panel: rgba(30, 41, 59, 0.7);
  --border-color: rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --danger: #ef4444;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 25%);
}

.screen {
  display: none;
}
.screen.active {
  display: flex;
}

.center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  width: 100%;
  box-sizing: border-box;
}

h1, h2, h3 { color: var(--text-main); }
.gradient-text {
  background: linear-gradient(to right, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 2.5rem;
  margin: 0 0 0.5rem 0;
}

.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px var(--primary-glow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
  filter: brightness(1.1);
}
.btn-primary:active { transform: translateY(0); }

.label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.input-wrapper { position: relative; }
.input-icon {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); width: 18px; height: 18px;
}
.input-field {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
  box-sizing: border-box;
}
.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.text-center { text-align: center; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 0.5s ease forwards; }

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

.loading-container {
  display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; gap: 1rem; width: 100%;
}

.loader {
  width: 48px; height: 48px; border: 3px solid var(--border-color); border-bottom-color: var(--primary);
  border-radius: 50%; display: inline-block; animation: rotation 1s linear infinite;
}
@keyframes rotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.icon-circle {
  width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem auto;
}
.icon-circle.danger { background: rgba(239, 68, 68, 0.1); }

.error-box {
  background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); padding: 1rem; border-radius: 8px;
  margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.5rem; color: #fca5a5; font-size: 0.875rem;
}

.logo-box {
  width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px var(--primary-glow);
}

.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem;
}

.project-card {
  padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; transition: transform 0.3s ease; cursor: pointer;
}
.project-card:hover { transform: translateY(-5px); }
.project-header { display: flex; justify-content: space-between; align-items: center; }
.project-icon { padding: 0.75rem; border-radius: 10px; background: rgba(59, 130, 246, 0.1); color: var(--primary); }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); }
.project-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.badge { font-size: 0.8rem; padding: 0.25rem 0.5rem; background: rgba(139, 92, 246, 0.2); color: var(--secondary); border-radius: 4px; font-weight: 600; }

/* Modal */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}

/* Tooltip */
.tooltip-container { position: relative; display: inline-flex; }
.tooltip-text {
  visibility: hidden;
  width: 250px;
  background-color: var(--bg-dark);
  color: var(--text-main);
  text-align: left;
  border-radius: 8px;
  padding: 1rem;
  position: absolute;
  z-index: 10;
  bottom: 150%;
  right: -10px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  font-size: 0.85rem;
  line-height: 1.5;
}
.tooltip-container:hover .tooltip-text { visibility: visible; }
