@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Fira+Code:wght@400;500&display=swap');

:root {
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-color: rgba(226, 232, 240, 0.6);
    --error-color: #ef4444;
    --success-color: #10b981;
    --blur-amount: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    background-image: url('/BG.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
}

/* Loading Screen */
.loading-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    background-image: url('/BG.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.loading-wrapper.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
}

.typewriter {
    font-family: 'Fira Code', monospace;
    font-size: 28px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 24px;
    position: relative;
    display: inline-block;
    letter-spacing: 1px;
}

.cursor {
    display: inline-block;
    width: 3px;
    height: 28px;
    background-color: var(--primary-color);
    margin-left: 6px;
    animation: blink 1s infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.loading-bar {
    width: 240px;
    height: 3px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.loading-progress {
    width: 0;
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.1s ease;
}

/* Animation */
.main-content {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.main-content.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes slideUpFade {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.main-content.visible .extract-container {
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Cards & Forms */
.card {
    background-color: var(--card-bg);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1), 0 10px 15px -5px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    width: 100%;
    max-width: 440px;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
}

.card-large {
    max-width: 1000px;
}

h1 {
    text-align: center;
    margin-bottom: 32px;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.form-group {
    margin-bottom: 24px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
}

input, select {
    width: 100%;
    padding: 14px 16px;
    background-color: rgba(248, 250, 252, 0.7);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.2s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background-color: #fff;
}

button {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2), 0 2px 4px -1px rgba(59, 130, 246, 0.1);
}

button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -2px rgba(59, 130, 246, 0.3), 0 3px 6px -2px rgba(59, 130, 246, 0.2);
}

button:active {
    transform: translateY(0);
}

/* Specific buttons */
.btn-sm {
    width: auto;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 8px;
    box-shadow: 0 2px 4px -1px rgba(59, 130, 246, 0.1);
}
.btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2);
}
.btn-danger {
    background-color: var(--error-color);
    box-shadow: 0 2px 4px -1px rgba(239, 68, 68, 0.1);
}
.btn-danger:hover {
    background-color: #dc2626;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2);
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.5);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: rgba(241, 245, 249, 0.6);
    font-weight: 600;
    font-size: 14px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: rgba(255, 255, 255, 0.8);
}

/* Data styling */
.file-size, .file-time, .file-key {
    color: #64748b;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

td:first-child {
    font-weight: 600;
    color: var(--text-color);
}

/* Messages */
.message {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.error-message {
    background-color: rgba(254, 242, 242, 0.85);
    color: var(--error-color);
    border: 1px solid rgba(254, 202, 202, 0.5);
    margin-top: 20px;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.05);
}

.success-message {
    background-color: rgba(236, 253, 245, 0.85);
    color: var(--success-color);
    border: 1px solid rgba(167, 243, 208, 0.5);
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.05);
}

/* Links */
.link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-top: 24px;
    transition: color 0.2s ease;
}

.link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.flex-center {
    display: flex;
    justify-content: center;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.no-files {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    font-size: 15px;
}

/* Extract Page Specific */
.extract-container {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    text-align: center;
    padding: 48px 32px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255,255,255,0.8);
    box-sizing: border-box;
}

.brand-header {
    margin-bottom: 32px;
}

.brand-icon {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    color: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px auto;
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.5);
    transform: rotate(-5deg);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-icon:hover {
    transform: rotate(0deg) scale(1.05);
}

.brand-icon svg {
    width: 32px;
    height: 32px;
}

.brand-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.brand-header p {
    font-size: 15px;
    color: #475569;
    font-weight: 500;
}

.extract-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.extract-form .input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 100px;
    padding: 4px;
    padding-left: 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), inset 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
    overflow: visible;
}

.extract-form .input-wrapper:focus-within {
    background: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 15px 30px -10px rgba(59, 130, 246, 0.3), 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.extract-form input {
    border: none;
    background: transparent;
    padding: 12px 0;
    font-size: 16px;
    flex: 1;
    min-width: 0;
    color: var(--text-color);
    font-weight: 500;
    letter-spacing: 0.5px;
    box-shadow: none !important;
    outline: none !important;
}

.extract-form input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Animated Button */
.animated-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 32px;
  border: 2px solid transparent;
  font-size: 16px;
  background-color: transparent;
  border-radius: 100px;
  font-weight: 600;
  color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-color);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  margin: 0;
  flex-shrink: 0;
  min-width: 120px;
  height: 44px;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.animated-button svg {
  position: absolute;
  width: 20px;
  fill: var(--primary-color);
  z-index: 9;
  transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.animated-button .arr-1 {
  right: 12px;
  transform: translateY(-50%);
  pointer-events: none;
}

.animated-button .arr-2 {
  left: -25%;
  transform: translateY(-50%);
  pointer-events: none;
}

.animated-button .circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background-color: var(--primary-color);
  border-radius: 50%;
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
  pointer-events: none;
}

.animated-button .text {
  position: relative;
  z-index: 1;
  transform: translateX(-10px);
  transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  line-height: 1;
  color: var(--primary-color);
  font-size: 16px;
  height: 100%;
  pointer-events: none;
}

.animated-button:hover {
  box-shadow: 0 0 0 6px transparent;
  color: transparent;
  border-radius: 12px;
}

.animated-button:hover .circle {
  width: 220px;
  height: 220px;
  opacity: 1;
}

.animated-button:hover .arr-1 {
  right: -25%;
  transform: translateY(-50%);
}

.animated-button:hover .arr-2 {
  left: 12px;
  transform: translateY(-50%);
}

.animated-button:hover .text {
  transform: translateX(10px);
  color: #fff;
}

.animated-button:hover svg {
  fill: #fff;
}

.animated-button:active {
  transform: scale(0.95);
  box-shadow: 0 0 0 2px var(--primary-color);
}

.extract-form .error-message {
    margin-top: 12px;
    border-radius: 12px;
    background-color: rgba(254, 242, 242, 0.9);
    border: 1px solid rgba(254, 202, 202, 0.5);
    color: var(--error-color);
    font-weight: 500;
    width: 100%;
    box-sizing: border-box;
}