/* style.css - Zarbik URL Shortener */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --secondary: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --dark: #1f2937;
  --light: #f9fafb;
  --gray: #6b7280;
  --border: #e5e7eb;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background-color: var(--light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo h1 {
  color: var(--primary);
  font-size: 1.8rem;
  margin-bottom: 0.2rem;
}

.tagline {
  color: var(--gray);
  font-size: 0.9rem;
}

nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

nav a {
  text-decoration: none;
  color: var(--dark);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.3s;
}

nav a:hover {
  background: var(--light);
  color: var(--primary);
}

nav a i {
  margin-right: 0.5rem;
}

.user-info {
  background: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
}

.admin-badge {
  background: var(--warning);
}

/* Main Content */
main {
  flex: 1;
  padding: 3rem 0;
}

.hero {
  text-align: center;
  padding: 3rem 0;
  max-width: 800px;
  margin: 0 auto;
}

.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--dark);
}

.hero p {
  color: var(--gray);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.shorten-form {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.shorten-form input {
  flex: 1;
  min-width: 250px;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
}

.shorten-form input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Buttons */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--light);
  color: var(--dark);
  border: 2px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
}

.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
}

.btn-small {
  padding: 0.3rem 0.8rem;
  font-size: 0.9rem;
}

/* Result Box */
.result-box {
  margin-top: 2rem;
}

.success, .error {
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.success {
  background: #d1fae5;
  border: 2px solid var(--secondary);
}

.error {
  background: #fee2e2;
  border: 2px solid var(--danger);
}

.success h4, .error h4 {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 4rem;
}

.feature {
  text-align: center;
  padding: 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.feature i {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.feature h3 {
  margin-bottom: 0.5rem;
}

/* Dashboard */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.form-box {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group input {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid var(--border);
  border-radius: 6px;
}

.urls-list {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.urls-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.urls-table th, .urls-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.urls-table th {
  background: var(--light);
  font-weight: 600;
}

.long-url {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--gray);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* Admin Styles */
.admin-section {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  margin-bottom: 2rem;
}

.config-box {
  padding: 1.5rem;
  background: var(--light);
  border-radius: 8px;
  margin-top: 1rem;
}

.config-control {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.config-control input {
  padding: 0.5rem;
  border: 2px solid var(--border);
  border-radius: 6px;
  width: 100px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.admin-table th, .admin-table td {
  padding: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.expired {
  color: var(--danger);
  font-weight: 600;
}

/* Footer */
footer {
  background: var(--dark);
  color: white;
  padding: 2rem 0;
  text-align: center;
  margin-top: auto;
}

footer a {
  color: var(--primary);
}

/* Login Page */
.login-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  margin-top: 4rem;
}

.login-container h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--primary);
}

.login-form input {
  width: 100%;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  header .container {
    flex-direction: column;
    gap: 1rem;
  }
  
  nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .shorten-form {
    flex-direction: column;
  }
  
  .shorten-form input {
    min-width: auto;
  }
  
  .dashboard-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .urls-table, .admin-table {
    display: block;
    overflow-x: auto;
  }
}