/* Modern CSS voor Stamboom applicatie */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.btn.btn-sm.btn-secondary, .btn.btn-sm.btn-secondary:hover {
    color: var(--bg-color) !important;
    text-decoration: none !important;
}

/* Navigation */
.navbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.nav-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: var(--bg-color);
}

.nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-user {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h2 {
    font-size: 2rem;
    font-weight: 700;
}

/* Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.divider {
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-light);
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border-color);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.form-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.person-form {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Person Cards */
.persons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.person-card {
    background: var(--card-bg);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.person-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.person-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.person-header h3 {
    font-size: 1.25rem;
    color: var(--text-color);
    margin: 0;
}

.person-header-large h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gender-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.person-info {
    margin-bottom: 1rem;
}

.person-info p {
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

.person-info strong {
    color: var(--text-color);
}

.person-text {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.person-text-full {
    color: var(--text-color);
    line-height: 1.8;
    white-space: pre-wrap;
}

.person-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Person Detail */
.person-detail {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.person-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.detail-section dl {
    display: grid;
    gap: 0.75rem;
}

.detail-section dt {
    font-weight: 600;
    color: var(--text-color);
}

.detail-section dd {
    color: var(--text-light);
    margin-left: 0;
}

.detail-section dd a {
    color: var(--primary-color);
    text-decoration: none;
}

.detail-section dd a:hover {
    text-decoration: underline;
}

.detail-section ul {
    list-style: none;
    padding: 0;
}

.detail-section ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-section ul li:last-child {
    border-bottom: none;
}

.detail-section ul li a {
    color: var(--primary-color);
    text-decoration: none;
}

.detail-section ul li a:hover {
    text-decoration: underline;
}

/* Photo Gallery */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.photo-item {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    border-radius: 0.375rem;
    background: var(--bg-color);
}

.photo-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* File List */
.file-list {
    list-style: none;
    padding: 0;
}

.file-list li {
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.file-list li a {
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.file-list li a:hover {
    text-decoration: underline;
}

/* Search */
.search-box {
    margin-bottom: 2rem;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.empty-state p {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

/* Users Table */
.users-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.users-section h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.user-form {
    margin-bottom: 2rem;
}

.users-table {
    overflow-x: auto;
}

.users-table table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.users-table th {
    background-color: var(--bg-color);
    font-weight: 600;
    color: var(--text-color);
}

.users-table tr:hover {
    background-color: var(--bg-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 0.5rem;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.close {
    color: var(--text-light);
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.close:hover {
    color: var(--text-color);
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-menu {
        width: 100%;
        margin-top: 1rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .persons-grid {
        grid-template-columns: 1fr;
    }
    
    .person-details-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}


/* Radiale layout */
.radial-wrap{
    width: 100%;
    overflow: auto;
    padding: 1rem;
  }
  
  .radial-canvas{
    position: relative;
    width: 2200px;
    height: 2200px;
    margin: 0 auto;
    border-radius: 9999px;
    background: radial-gradient(circle, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0) 60%);
  }
  
  .radial-ring{
    position:absolute;
    left:50%;
    top:50%;
    transform: translate(-50%,-50%);
    border: 1px dashed var(--border-color);
    border-radius: 50%;
    pointer-events:none;
  }
  
  .ring-0{ width: 250px; height: 250px; }
  .ring-1{ width: 700px; height: 700px; }
  .ring-2{ width: 1100px; height: 1100px; }
  .ring-3{ width: 1500px; height: 1500px; }
  .ring-4{ width: 1900px; height: 1900px; }
  
  /* Node position: centrum + polar transform */
  .radial-node{
    position:absolute;
    left:50%;
    top:50%;
    transform:
      translate(-50%,-50%)
      rotate(var(--angle))
      translate(var(--radius))
      rotate(calc(var(--angle) * -1));
  
    border-radius: 9999px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
    cursor: pointer;
    user-select: none;
    padding: .9rem 1rem;
    text-align: center;
    transition: transform .15s, box-shadow .15s, border-color .15s;
    min-width: 170px;
    max-width: 230px;
  }
  
  .radial-node:hover{
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
  }
  
  /* Radius per generatie (ring) */
  /* .radial-node.depth-0{ --radius: 0px; width: 250px; height: 250px; display:flex; flex-direction:column; justify-content:center; }
  .radial-node.depth-1{ --radius: 350px; }
  .radial-node.depth-2{ --radius: 550px; }
  .radial-node.depth-3{ --radius: 750px; }
  .radial-node.depth-4{ --radius: 950px; } */

  .radial-node.depth-0{
    --radius: 0px;
    width: 220px;
    height: 220px;
  }
  
  .radial-node.depth-1{ --radius: 150px; }
  .radial-node.depth-2{ --radius: 250px; }
  .radial-node.depth-3{ --radius: 350px; }
  .radial-node.depth-4{ --radius: 450px; }
  
  
  /* Kleuren obv geslacht */
  .radial-node.gender-female{ background: #fbcfe8; }   /* roze */
  .radial-node.gender-male{ background: #bfdbfe; }     /* licht-blauw */
  .radial-node.gender-unknown{ background: #fef9c3; }  /* licht-geel */
  
  /* Tekst */
  .radial-name{
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
  }
  
  .radial-date{
    margin-top: .35rem;
    font-size: .85rem;
    color: rgba(0,0,0,.65);
  }
  
  .radial-actions{
    margin-top: .5rem;
    display:flex;
    justify-content:center;
    gap:.5rem;
  }
  
  .radial-view{
    font-size: .85rem;
    text-decoration: none;
    padding: .25rem .6rem;
    border-radius: 9999px;
    background: rgba(255,255,255,.55);
    color: rgba(0,0,0,.75);
    border: 1px solid rgba(0,0,0,.1);
  }
  .radial-view:hover{
    background: rgba(255,255,255,.85);
  }
  
  /* Mobile: canvas blijft scrollbaar, nodes iets smaller */
  @media (max-width: 768px){
    .radial-canvas{ width: 1600px; height: 1600px; }
    .ring-0{ width: 250px; height: 250px; }
    .ring-1{ width: 520px; height: 520px; }
    .ring-2{ width: 820px; height: 820px; }
    .ring-3{ width: 1120px; height: 1120px; }
    .ring-4{ width: 1420px; height: 1420px; }
  
    .radial-node{ min-width: 150px; max-width: 200px; }
    .radial-node.depth-1{ --radius: 260px; }
    .radial-node.depth-2{ --radius: 410px; }
    .radial-node.depth-3{ --radius: 560px; }
    .radial-node.depth-4{ --radius: 710px; }
  }

  .radial-wrap{ width:100%; overflow:auto; padding:1rem; }

.radial-canvas{
  position: relative;
  width: 2200px;
  height: 2200px;
  margin: 0 auto;
}

.radial-ring{
  position:absolute; left:50%; top:50%;
  transform: translate(-50%,-50%);
  border: 1px dashed var(--border-color);
  border-radius: 50%;
  pointer-events:none;
}
.ring-0{ width: 250px; height: 250px; }
.ring-1{ width: 700px; height: 700px; }
.ring-2{ width: 1100px; height: 1100px; }
.ring-3{ width: 1500px; height: 1500px; }
.ring-4{ width: 1900px; height: 1900px; }

.radial-node{
  position:absolute;
  left:50%; top:50%;
  transform:
    translate(-50%,-50%)
    rotate(var(--angle))
    translate(var(--radius))
    rotate(calc(var(--angle) * -1));
  border-radius: 9999px;
  border: 2px solid var(--border-color);
  padding: .9rem 1rem;
  text-align:center;
  cursor:pointer;
  z-index: 2;
}

.radial-node.depth-0{ --radius: 0px; width:250px; height:250px; display:flex; flex-direction:column; justify-content:center; }
.radial-node.depth-1{ --radius: 350px; }
.radial-node.depth-2{ --radius: 550px; }
.radial-node.depth-3{ --radius: 750px; }
.radial-node.depth-4{ --radius: 950px; }

.radial-node.gender-female{ background:#fbcfe8; }   /* roze */
.radial-node.gender-male{ background:#bfdbfe; }     /* lichtblauw */
.radial-node.gender-unknown{ background:#fef9c3; }  /* geel */

.radial-lines{ position:absolute; inset:0; pointer-events:none; z-index:1; }
.radial-line{ stroke: rgba(0,0,0,.25); stroke-width:2; }
