:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --text: #1e293b;
    --text-light: #64748b;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --success: #10b981;
    --error: #ef4444;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] {
    --text: #f1f5f9;
    --text-light: #94a3b8;
    --bg: #0f172a;
    --card-bg: #1e293b;
    --border: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

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

nav a {
    color: white;
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
    transition: opacity 0.2s;
}

.headertitle {
    color: white;
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
    transition: opacity 0.2s;
}

nav a:hover {
    opacity: 0.8;
}

.headertitle:hover {
    opacity: 0.8;
}

#theme-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: transform 0.2s;
}

#theme-toggle:hover {
    transform: scale(1.1);
}

/* Dashboard Styles */
.dashboard {
    padding: 2rem 0;
    text-align: center;
}

.examcard {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    text-align: center;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    text-align: center;
}

.card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
    border: 1px solid var(--border);
    text-align: center;
}

.card:hover {
    transform: translateY(-5px);
}

.card h2 {
    margin: 1rem 0;
}

.btn {
    display: inline-block;
    background: var(--primary);
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    margin-top: 1rem;
    transition: background 0.2s;
}

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

.form-actions {
    text-align: center;
    margin-top: 2rem;
}

footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-light);
    border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
    .cards {
        grid-template-columns: 1fr;
    }

    header .container {
        flex-direction: column;
        gap: 1rem;
    }

    nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    nav a {
        margin: 0;
    }
}

.disabled-link {
  cursor: not-allowed;
  color: gray !important;
  position: relative;
  text-decoration: none;
}

/* ===== VLSM CALCULATOR STYLES ===== */
.vlsm-section {
  padding: 2rem 0;
}

.form {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
}

.input-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  width: 100%;
}

.input-group input {
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 120px;
  background: var(--card-bg);
  color: var(--text);
}

.single-line {
  margin-bottom: 1.5rem;
  flex-direction: row;
  align-items: center;
}

.subnet-list {
  width: 100%;
  margin-bottom: 1.5rem;
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.subnet-entry {
  margin-bottom: 0.75rem;
}

.button-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
  width: 100%;
}

.result {
  width: 100%;
  margin-top: 2rem;
}

.table-container {
  overflow-x: auto;
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  background: var(--card-bg);
}

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

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

th {
  background-color: var(--primary);
  color: white;
}

@media (max-width: 768px) {
  .input-group {
    flex-direction: column;
    align-items: stretch;
  }

  .single-line {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .button-row {
    flex-direction: column;
    align-items: stretch;
  }

  .button-row .btn {
    width: 100%;
    margin: 0.25rem 0;
  }

  table {
    font-size: 0.85rem;
  }
}

/* ===== IP CALCULATOR STYLES ===== */
.ipcalc-section {
    padding: 2rem 0;
}

#ipcalcForm {
    max-width: 600px;
    margin: 0 auto;
}

#cidrPrefix {
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    width: 100%;
}

.result-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.result-card h2 {
    margin-top: 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #cidrPrefix {
        font-size: 0.85rem;
    }
}

/* ===== SUMMARIZER STYLES ===== */
.summ-section {
    padding: 2rem 0;
}

#summForm {
    max-width: 800px;
    margin: 0 auto;
}

#subnets {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    min-height: 200px;
    font-family: monospace;
}

.info-card {
    margin-bottom: 2rem;
    text-align: left;
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid var(--primary);
}

.info-card h3 {
    margin-top: 0;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.result-table {
    width: 100%;
    margin-top: 1.5rem;
    border-collapse: collapse;
}

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

.result-table th {
    background-color: var(--primary);
    color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #subnets {
        font-size: 0.85rem;
    }

    .info-card {
        padding: 1rem;
    }
}
