/* === FONT & THEME VARIABLES === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --hue-primary: 240; /* Indigo */
  --hue-secondary: 280; /* Magenta/Purple */
  --hue-success: 135; /* Green */
  --hue-danger: 350;  /* Red */

  /* Light Mode */
  --bg-main: #f8f9fc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f3f8;
  --border: rgba(0, 0, 0, 0.08);
  --text-primary: #1a202c;
  --text-secondary: #5a677d;
  --shadow-color: 220, 40%, 50%;
  --primary: hsl(var(--hue-primary), 90%, 65%);
  --primary-dark: hsl(var(--hue-primary), 90%, 55%);
  --success: hsl(var(--hue-success), 60%, 45%);
  --success-dark: hsl(var(--hue-success), 60%, 35%);
  --danger: hsl(var(--hue-danger), 80%, 55%);
  --grad-1: hsl(var(--hue-primary), 100%, 85%);
  --grad-2: hsl(var(--hue-secondary), 100%, 90%);
}

/* === BASE & LAYOUT === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 2rem 1rem;
  position: relative;
  overflow-x: hidden;
}

body::before, body::after {
  content: ''; position: fixed; z-index: -1;
  border-radius: 50%; filter: blur(150px);
  transition: background-color 0.5s;
}
body::before { width: 500px; height: 500px; background: var(--grad-1); top: -20%; left: -10%; animation: pulse 15s infinite alternate; }
body::after { width: 600px; height: 600px; background: var(--grad-2); bottom: -25%; right: -15%; animation: pulse 20s infinite alternate-reverse; }
@keyframes pulse { from { transform: scale(0.8); } to { transform: scale(1.2); } }

.app-container {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: center;
  z-index: 1;
}

.app-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    position: relative;
    width: 100%;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.install-btn {
    background-color: var(--bg-card);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.install-btn:hover {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(var(--shadow-color), 0.1);
}

/* === TOOL CARD === */
.tool-card {
  background-color: var(--bg-card);
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(var(--shadow-color), 0.1);
  border: 1px solid var(--border);
}

.tool-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.tool-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  color: white;
}

.tool-btn.primary { background-color: var(--primary); }
.tool-btn.primary:hover { background-color: var(--primary-dark); }
.tool-btn.success { background-color: var(--success); }
.tool-btn.success:hover { background-color: var(--success-dark); }

.tool-btn.secondary {
  background-color: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: calc(0.8rem - 2px) calc(1.5rem - 2px);
}
.tool-btn.secondary:hover {
  background-color: var(--primary);
  color: white;
}

.tool-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.file-name {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    min-height: 24px;
}

/* === MODAL & LOADER === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  background-color: var(--bg-card);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(var(--shadow-color), 0.2);
  width: 90%;
  max-width: 400px;
  text-align: center;
  position: relative;
  transform: scale(1);
  transition: transform 0.3s ease;
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.9);
}

.modal-content h3 {
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.modal-content p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--text-secondary);
  cursor: pointer;
}

#password-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#password-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background-color: var(--bg-subtle);
  color: var(--text-primary);
}

.error-message {
    color: var(--danger);
    font-weight: 500;
    margin-top: 1rem;
}

/* Loader Styles */
.loader-content {
    background: var(--bg-card);
    padding: 2rem 3rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.loader-content i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
    animation: spin 1.5s linear infinite;
}
.loader-content p {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hidden {
  display: none !important;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 600px) {
    body {
        padding: 1rem;
    }
    h1 {
        font-size: 1.8rem;
    }
    .tool-card {
        padding: 1.5rem;
    }
    .tool-actions {
        flex-direction: column;
    }
    .tool-btn {
        width: 100%;
    }
}