* {
    box-sizing: border-box;
}

body {
      font-family: 'Tajawal', sans-serif;
      direction: rtl;
      background-color: #f0f2f5;
      margin: 0;
      padding: 20px;
      color: #333;
      transition: background-color 0.3s, color 0.3s;
      position: relative;
      z-index: 1;
    }

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/bg.avif') no-repeat center center/cover;
    opacity: 0.05;
    z-index: -1;
}

    h1 {
      font-weight: 700;
      color: #1e40af;
      text-align: center;
      font-size: 1.5em;
      margin-bottom: 25px;
      text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    }
    
    h1 span {
        font-size: 0.8em;
        color: #4a5568;
    }

    .notice-container {
        background-color: #e9f5ff;
        border-right: 5px solid #2b6cb0;
        padding: 20px;
        margin: 0 auto 30px;
        text-align: center;
        width: 80%;
        max-width: 950px;
        border-radius: 15px;
        box-shadow: 0 6px 15px rgba(0,0,0,0.07);
    }

    .notice-container p {
        margin: 0;
        padding: 6px 0;
        font-size: 1.15em;
        color: #2d3748;
        font-weight: 600;
        line-height: 1.6;
    }

    .card {
      background: #ffffff;
      border-radius: 20px;
      padding: 30px;
      margin: 0 auto 25px;
      box-shadow: 0 12px 24px rgba(0,0,0,0.08);
      transition: transform 0.3s ease, box-shadow 0.3s ease;
      width: 80%;
      max-width: 950px;
      position: relative;
      border: none;
    }

    .card::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 20px;
        padding: 5px; /* border width */
        background: linear-gradient(135deg, #c0392b, #27ae60);
        -webkit-mask:
            linear-gradient(#fff 0 0) content-box,
            linear-gradient(#fff 0 0);
        mask:
            linear-gradient(#fff 0 0) content-box,
            linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        pointer-events: none;
    }

    .card:hover {
        transform: translateY(-5px);
        box-shadow: 0 18px 36px rgba(0,0,0,0.12);
    }

    #profile-image {
        width: 200px;
        height: 200px;
        border-radius: 20px;
        background-size: cover;
        background-position: center;
        background-color: #e5e7eb;
    }

    .breadcrumb {
      margin-bottom: 25px;
      font-weight: 600;
      font-size: 1.1em;
      text-align: center;
    }
    
    .breadcrumb span {
      cursor: pointer;
      color: #2b6cb0;
      padding: 8px 15px;
      border-radius: 10px;
      transition: all 0.3s ease;
      margin: 0 5px;
    }
    
    .breadcrumb span:hover {
      background-color: #bee3f8;
      color: #2c5282;
    }
    
    .breadcrumb span.active {
      background-color: #2b6cb0;
      color: white;
      box-shadow: 0 4px 8px rgba(43,108,176,0.3);
    }

    .breadcrumb-separator {
        color: #a0aec0;
        font-weight: bold;
        margin: 0 5px;
        pointer-events: none;
    }

    #navigation-area {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin: 0 auto 20px;
        flex-wrap: wrap;
        gap: 15px;
        width: 80%;
        max-width: 950px;
    }

    #nav-controls {
        display: flex;
        gap: 10px;
        order: 2; /* RTL: buttons on the left */
    }

    .breadcrumb {
        order: 1; /* RTL: breadcrumb on the right */
        flex-grow: 1;
        text-align: center;
    }

    #nav-controls button {
        padding: 10px 20px;
        font-size: 1em;
        font-weight: 600;
    }

    .nav-button {
        background-color: #ffffff;
        color: #2b6cb0;
        border: 2px solid #e2e8f0;
        border-radius: 12px;
        padding: 12px 24px;
        font-size: 1.1em;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    }

    .nav-button:hover {
        transform: translateY(-3px);
        border-color: #2b6cb0;
        box-shadow: 0 7px 15px rgba(43,108,176,0.15);
    }

    .nav-button:active {
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(43,108,176,0.1);
    }

    .parents {
      display: flex;
      justify-content: center;
      gap: 20px;
      margin-bottom: 20px;
      text-align: center;
      padding: 20px;
      background: #f7fafc;
      border-radius: 15px;
      border: 1px solid #e2e8f0;
    }

    .parent-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 10px;
      flex: 1;
    }

    .parent-container.clickable {
        cursor: pointer;
        transition: background-color 0.3s, transform 0.3s;
        padding: 10px;
        border-radius: 15px;
    }

    .parent-container.clickable:hover {
        background-color: #e9eef3;
        transform: translateY(-3px);
    }

    .parent-container img {
      width: 80px;
      height: 80px;
      border-radius: 20px;
      border: 3px solid #e2e8f0;
      background-color: #fff;
    }

    .parent-container span {
      font-weight: 600;
      font-size: 1.1em;
      color: #2d3748;
    }

    .children {
      display: flex;
      flex-wrap: wrap;
      gap: 15px;
      margin-top: 15px;
      justify-content: center;
    }

    .child-button {
      padding: 14px 24px;
      background: transparent;
      color: #2b6cb0;
      border: 2px solid #2b6cb0;
      border-radius: 10px;
      cursor: pointer;
      font-weight: 700;
      transition: all 0.3s ease;
      box-shadow: 0 4px 6px rgba(0,0,0,0.1);
      font-size: 1.2em;
    }
    
    .child-button:hover {
      background: #2b6cb0;
      color: white;
      transform: translateY(-2px);
      box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    }

    .footer {
      margin-top: 0;
      font-size: 1em;
      color: #4a5568;
      text-align: center;
      padding: 12px 20px;
      border-radius: 12px;
      background-color: #f7fafc;
      border: 1px solid #e2e8f0;
      display: inline-block;
      font-weight: 600;
    }

    .footer-container {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 20px;
        flex-wrap: wrap;
        text-align: center;
        margin: 40px auto 0;
        padding: 20px;
        background: #ffffff;
        border-radius: 20px;
        box-shadow: 0 12px 24px rgba(0,0,0,0.08);
        width: 80%;
        max-width: 950px;
        position: relative;
        border: none;
    }

    .footer-container::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 20px;
        padding: 5px; /* border width */
        background: linear-gradient(135deg, #c0392b, #27ae60);
        -webkit-mask:
            linear-gradient(#fff 0 0) content-box,
            linear-gradient(#fff 0 0);
        mask:
            linear-gradient(#fff 0 0) content-box,
            linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        pointer-events: none;
    }

    .wives-section {
      margin-top: 25px;
      padding: 20px;
      border-radius: 15px;
      background-color: #f8fafd;
      border: 1px solid #e6eaf1;
      text-align: center;
    }
    
    .wife-title {
      font-weight: 700;
      margin-bottom: 15px;
      color: #1e40af;
      font-size: 1.3em;
      display: inline-block;
      background-color: #dbeafe;
      padding: 8px 20px;
      border-radius: 12px;
    }

    #search-container {
        position: relative;
        width: 80%;
        max-width: 950px;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 25px;
        display: block;
        box-sizing: border-box;
    }
    
    #search-input {
        width: 100%;
        padding: 15px 20px;
        border: 1px solid #cbd5e0;
        border-radius: 10px;
        font-size: 1.1em;
        transition: border-color 0.3s, box-shadow 0.3s;
        box-sizing: border-box;
        display: block;
    }

    #search-input:focus {
        outline: none;
        border-color: #4299e1;
        box-shadow: 0 0 0 3px rgba(66,153,225,0.5);
    }
    
    #search-results {
        position: absolute;
        width: 100%;
        background: white;
        border: 1px solid #cbd5e0;
        border-top: none;
        max-height: 250px;
        overflow-y: auto;
        z-index: 1000;
        border-radius: 0 0 10px 10px;
        box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    }
    
    .search-result-item {
        padding: 15px;
        cursor: pointer;
        font-size: 1.05em;
        border-bottom: 1px solid #e2e8f0;
    }

    .search-result-item:last-child {
        border-bottom: none;
    }
    
    .search-result-item:hover {
        background: #ebf8ff;
    }

    #nav-controls {
        margin-bottom: 20px;
        text-align: center;
    }

    #zoom-controls {
        display: flex;
        justify-content: center;
        gap: 15px;
        margin: 20px 0;
        align-items: center;
    }

    #zoom-controls button {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        border: none;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        font-size: 1.8em;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        overflow: hidden;
    }

    #zoom-controls button::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.3);
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s;
    }

    #zoom-controls button:hover::before {
        width: 300px;
        height: 300px;
    }

    #zoom-controls button:hover {
        transform: translateY(-3px) scale(1.05);
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
        background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    }

    #zoom-controls button:active {
        transform: translateY(-1px) scale(0.98);
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }

    #zoom-controls button:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }

    #zoom-in {
        background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
        box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
    }

    #zoom-in:hover {
        background: linear-gradient(135deg, #38ef7d 0%, #11998e 100%);
        box-shadow: 0 8px 25px rgba(17, 153, 142, 0.6);
    }

    #zoom-out {
        background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
        box-shadow: 0 4px 15px rgba(238, 9, 121, 0.4);
    }

    #zoom-out:hover {
        background: linear-gradient(135deg, #ff6a00 0%, #ee0979 100%);
        box-shadow: 0 8px 25px rgba(238, 9, 121, 0.6);
    }

    #zoom-reset {
        background: linear-gradient(135deg, #2b6cb0 0%, #4299e1 100%);
        box-shadow: 0 4px 15px rgba(43, 108, 176, 0.4);
    }

    #zoom-reset:hover {
        background: linear-gradient(135deg, #4299e1 0%, #2b6cb0 100%);
        box-shadow: 0 8px 25px rgba(43, 108, 176, 0.6);
    }

    #zoom-controls button span {
        position: relative;
        z-index: 1;
    }

    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 2000;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .modal-overlay.visible {
        opacity: 1;
        visibility: visible;
    }

    .modal-content {
        background: white;
        padding: 30px 40px;
        border-radius: 15px;
        text-align: center;
        box-shadow: 0 8px 20px rgba(0,0,0,0.25);
        max-width: 400px;
        width: 90%;
        position: relative;
        border: none;
    }

    .modal-content::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 15px;
        padding: 5px; /* border width */
        background: linear-gradient(135deg, #c0392b, #27ae60);
        -webkit-mask:
            linear-gradient(#fff 0 0) content-box,
            linear-gradient(#fff 0 0);
        mask:
            linear-gradient(#fff 0 0) content-box,
            linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        pointer-events: none;
    }

    .modal-content p {
        font-size: 1.2em;
        color: #2d3748;
        margin: 0 0 25px 0;
    }

    #modal-close {
        padding: 12px 30px;
        background: #2b6cb0;
        color: white;
        border: none;
        border-radius: 10px;
        cursor: pointer;
        font-weight: 600;
        font-size: 1.1em;
        transition: background 0.3s ease;
    }

    #modal-close:hover {
        background: #2c5282;
    }

    #modal-action-button {
        padding: 12px 25px;
        background: #48bb78;
        color: white;
        border: none;
        border-radius: 10px;
        cursor: pointer;
        font-weight: 600;
        font-size: 1.1em;
        transition: background 0.3s ease;
        margin-left: 10px;
        display: none;
    }

    #modal-action-button.visible {
        display: inline-block;
    }

    #modal-action-button:hover {
        background: #38a169;
    }

    #suggest-edit-button {
        padding: 15px 25px;
        background-color: #2b6cb0;
        color: white;
        border: none;
        border-radius: 12px;
        cursor: pointer;
        font-weight: 700;
        font-size: 1.1em;
        box-shadow: 0 5px 15px rgba(0,0,0,0.15);
        transition: all 0.3s ease;
        margin-top: 0;
        display: inline-block;
    }

    #suggest-edit-button:hover {
        background-color: #2c5282;
        transform: translateY(-2px);
    }

    #suggest-edit-modal .modal-content {
        max-width: 700px;
        max-height: 90vh; /* Increased from 80vh */
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        padding: 20px; /* Added padding */
        border-radius: 15px; /* Ensure radius is applied */
    }

    /* Statistics Container */
.statistics-container {
    background-color: #f0f9ff;
    border-right: 5px solid #0ea5e9;
    padding: 20px;
    margin: 0 auto 30px;
    text-align: center;
    width: 80%;
    max-width: 950px;
    border-radius: 15px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.07);
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
    flex: 1;
}

.stat-value {
    font-size: 2.5em;
    font-weight: 700;
    color: #0369a1;
}

.stat-label {
    font-size: 1.1em;
    font-weight: 600;
    color: #4a5568;
}

    #suggest-edit-modal h2 {
        margin-top: 0;
        color: #2d3748;
    }

    #suggest-edit-modal input[type="text"],
    #suggest-edit-modal input[type="email"] {
        width: 100%;
        padding: 14px;
        border: 1px solid #cbd5e0;
        border-radius: 10px;
        font-size: 1em;
        margin-bottom: 15px;
        box-sizing: border-box;
        text-align: right;
    }

    #suggestion-textarea {
        width: 100%;
        height: 150px;
        padding: 15px;
        border: 1px solid #cbd5e0;
        border-radius: 10px;
        font-size: 1em;
        margin-bottom: 20px;
        resize: vertical;
    }

    #anti-bot-section {
        margin-top: 10px;
        margin-bottom: 20px;
        padding: 15px;
        background-color: #f7fafc;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
        flex-wrap: wrap;
    }

    #anti-bot-section label {
        font-weight: 600;
        color: #4a5568;
        font-size: 1.05em;
    }

    #bot-question {
        font-weight: 700;
        font-size: 1.2em;
        color: #2b6cb0;
    }

    #bot-answer {
        width: 80px;
        padding: 10px;
        border: 1px solid #cbd5e0;
        border-radius: 8px;
        font-size: 1.1em;
        text-align: center;
        font-weight: bold;
    }

    #suggest-edit-modal button {
        padding: 14px 35px;
        border-radius: 10px;
        cursor: pointer;
        font-weight: 600;
        font-size: 1.1em;
        transition: background 0.3s ease;
        border: none;
    }

    #submit-suggestion {
        background: #2b6cb0;
        color: white;
        margin-right: 10px;
    }

    #submit-suggestion:hover {
        background: #2c5282;
    }

    #cancel-suggestion {
        background: #e53e3e;
        color: white;
    }

    #cancel-suggestion:hover {
        background: #c53030;
    }

    #request-type, #claim-marital-status {
        width: 100%;
        padding: 14px;
        border: 1px solid #cbd5e0;
        border-radius: 10px;
        font-size: 1em;
        margin-bottom: 15px;
        box-sizing: border-box;
        background-color: #f7fafc;
        text-align: right;
    }

    #claim-fields {
        display: none; /* Initially hidden */
        margin-top: 15px;
    }

    .claim-prompt {
        font-size: 1.1em !important;
        font-weight: 600;
        color: #2b6cb0 !important;
        background-color: #e9f5ff;
        padding: 10px;
        border-radius: 8px;
        margin-bottom: 15px !important;
    }

    #suggest-edit-modal #claim-fields input[type="text"],
    #suggest-edit-modal #claim-fields textarea {
        width: 100%;
        padding: 14px;
        border: 1px solid #cbd5e0;
        border-radius: 10px;
        font-size: 1em;
        margin-bottom: 15px;
        box-sizing: border-box;
        text-align: right;
    }

    .person-details {
        margin-top: 20px;
        padding: 15px;
        background: #f7fafc;
        border-radius: 12px;
        border: 1px solid #e2e8f0;
        text-align: right;
    }

    .detail-item {
        margin-bottom: 8px;
        font-size: 1.1em;
        color: #4a5568;
    }

    .detail-item strong {
        color: #2d3748;
        margin-left: 8px;
    }

    /* Remove obsolete verify button styles */
    .verify-button-container,
    .verify-button,
    .verify-button:hover,
    #verify-modal .modal-content,
    #verify-modal input,
    #verify-modal select,
    #verify-modal textarea {
        display: none; /* Effectively remove them */
    }

    .children-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
        margin-top: 15px;
        justify-content: center;
    }

    .child-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        cursor: pointer;
        padding: 10px;
        border-radius: 15px;
        transition: background-color 0.3s, transform 0.3s;
        text-align: center;
    }

    .child-container:hover {
        background-color: #e9eef3;
        transform: translateY(-3px);
    }

    .child-container img {
        width: 70px;
        height: 70px;
        border-radius: 20px;
        border: 3px solid #e2e8f0;
        background-color: #fff;
        object-fit: cover;
    }

    .child-container span {
        font-weight: 600;
        font-size: 1em;
        color: #2d3748;
    }

    .no-children-message {
        padding: 15px;
        text-align: center;
        color: #718096;
        font-size: 1.1em;
    }

    .made-by {
        text-align: center;
        margin-top: 20px;
        margin-bottom: 20px;
        font-size: 1em;
        color: #4a5568;
        font-weight: 600;
    }
