/* ============================================= */
/*  SvS COORDINATION TOOL – style.css            */
/*  Matches your existing calculator design      */
/*  Full dark mode + mobile responsive           */
/* ============================================= */

:root {
  --primary: #2d9cdb;
  --primary-light: #4ab3e8;
  --primary-dark: #1d7ab8;
  --background: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --input-bg: #f9fafb;
  --slot-bg: #f1f5f9;
  --select-bg: white;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 12px;
  --transition: all 0.2s ease;
  --success: #16a34a;
  --error: #dc2626;
  --warning: #f59e0b;
}

body[data-theme="dark"] {
  --background: #0f172a;
  --card-bg: #1e293b;
  --text: #f1f5f9;
  --text-light: #94a3b8;
  --border: #334155;
  --input-bg: #334155;
  --slot-bg: #1e293b;
  --select-bg: #334155;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -1px rgba(0,0,0,0.3);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -2px rgba(0,0,0,0.4);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
  gap: 1rem;
}

.navbar a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.navbar a:hover {
  color: var(--primary-dark);
}

.home-btn {
  font-size: 1.5rem;
  font-weight: 700;
}

.alliance-badge {
  background: rgba(45, 156, 219, 0.2);
  color: var(--primary);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.85rem;
  margin: 0 0.5rem;
}

.logout {
  background: #dc2626;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

/* Main container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  padding-top: 100px; /* Offset for fixed navbar */
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.admin-quick {
  background: linear-gradient(135deg, #1e40af, #1d7ab8);
  color: white;
  text-align: center;
  border: none;
}

.admin-quick button {
  background: #10b981;
  margin: 0.5rem;
}

/* Messages */
.msg {
  padding: 1rem;
  border-radius: var(--radius);
  margin: 1rem 0;
  font-weight: 500;
}

.msg.success {
  background: #dcfce7;
  color: #16a34a;
  border: 1px solid #86efac;
}

.msg.error {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

.tab {
  padding: 0.75rem 1.5rem;
  background: var(--slot-bg);
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.tab.active {
  background: var(--primary);
  color: white;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Block grid (2-hour blocks) */
.block-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.block-item {
  background: var(--slot-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.block-item:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.block-item input[type="checkbox"] {
  margin-right: 0.5rem;
  transform: scale(1.2);
}

.block-item small {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-light);
  font-size: 0.85rem;
}

/* Input groups */
.input-group {
  margin: 1rem 0;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.input-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-bg);
  font-size: 1rem;
  transition: var(--transition);
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(45, 156, 219, 0.2);
}

.required { color: var(--error); }

/* Buttons */
button, .primary-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 6px rgba(45, 156, 219, 0.25);
}

button:hover, .primary-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(45, 156, 219, 0.35);
}

button:active {
  transform: translateY(0);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--slot-bg);
  font-weight: 600;
  color: var(--text);
}

tr:hover {
  background: var(--slot-bg);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.modal-content {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 90%;
  max-height: 90%;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-md);
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-light);
  transition: var(--transition);
}

.close-modal:hover {
  color: var(--error);
}

.sub-slot {
  background: var(--slot-bg);
  padding: 1rem;
  border-radius: var(--radius);
  margin: 1rem 0;
  border: 1px solid var(--border);
}

.sub-slot select {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--select-bg);
  font-size: 1rem;
}

/* Confirm button in modal */
#confirm-slots-btn {
  background: #16a34a;
  font-size: 1.1rem;
  padding: 1rem 3rem;
  margin-top: 1.5rem;
}

#confirm-slots-btn:hover {
  background: #15803d;
}

/* Responsive */
@media (max-width: 768px) {
  .navbar {
    padding: 1rem;
    flex-direction: column;
    text-align: center;
  }

  .container {
    padding: 1rem;
    padding-top: 140px;
  }

  .block-grid {
    grid-template-columns: 1fr 1fr;
  }

  .tabs {
    justify-content: center;
  }

  .tab {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  table {
    font-size: 0.9rem;
  }

  th, td {
    padding: 0.75rem 0.5rem;
  }
}

@media (max-width: 480px) {
  .block-grid {
    grid-template-columns: 1fr;
  }

  .input-group input {
    font-size: 1rem;
  }
}

/* ==================== SvS NAVBAR ==================== */
.svs-navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 1rem;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-home {
    background: var(--primary);
    color: white !important;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-home:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.nav-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.nav-spacer {
    flex: 1;
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .nav-title {
        font-size: 1.1rem;
    }
    .nav-home {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
}