<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>OSRS Services | Skilling, Bossing, PvM, OSRS Gold</title>
    <link rel="stylesheet" href="styles.css">
    <link rel="icon" href="favicon.png" type="image/png">
    <style>
      /* Smooth Page Transition */
      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }

      html {
        scroll-behavior: smooth;
      }

      body {
        margin: 0;
        font-family: 'Roboto', sans-serif;
        background: url('background.png') no-repeat center center fixed;
        background-size: cover;
        overflow-y: scroll;
        position: relative;
      }

      /* Custom Scrollbar */
      ::-webkit-scrollbar {
        width: 8px;
      }

      ::-webkit-scrollbar-track {
        background: #f1f1f1;
      }

      ::-webkit-scrollbar-thumb {
        background: #2ea2cc;
        border-radius: 4px;
      }

      ::-webkit-scrollbar-thumb:hover {
        background: #1f6bb5;
      }

      .navbar {
        background: rgba(9, 55, 144, 0);
        /* New color with 80% transparency */
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 20px;
        position: sticky;
        top: 0;
        z-index: 1000;
      }

      .navbar .logo img {
        height: 50px;
      }

      .navbar .logo a {
        text-decoration: none;
      }

      .navbar ul {
        list-style: none;
        display: flex;
        margin: 0;
        padding: 0;
      }

      .navbar ul li {
        position: relative;
      }

      .navbar ul li a {
        color: white;
        text-decoration: none;
        font-weight: 600;
        padding: 10px 15px;
        display: block;
      }

      .navbar ul li.has-dropdown>a::after {
        content: '\25BC';
        margin-left: 8px;
        font-size: 0.8em;
      }

      .navbar ul li:hover>a {
        background: rgba(6, 40, 104, 0.8);
      }

      .navbar ul li .dropdown {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background: rgba(6, 40, 104, 0.9);
        min-width: 200px;
        z-index: 1001;
      }

      .navbar ul li:hover .dropdown,
      .navbar ul li.show .dropdown {
        display: block;
      }

      .dropdown li {
        width: 100%;
      }

      .dropdown li a {
        padding: 10px;
        color: white;
      }

      .dropdown li a:hover {
        background-color: rgba(4, 30, 78, 0.9);
      }

      .menu-toggle {
        display: none;
        cursor: pointer;
        color: white;
        font-size: 1.5em;
        margin-left: 20px;
        z-index: 1001;
        transition: transform 0.3s ease;
      }

      .menu-toggle.active {
        transform: rotate(90deg);
      }

      @media (max-width: 768px) {
        .navbar ul {
          flex-direction: column;
          display: none;
          background: rgba(9, 55, 144, 0.9);
          position: absolute;
          top: 60px;
          right: 0;
          width: 100%;
          transition: all 0.5s ease-in-out;
        }

        .navbar ul.active {
          display: flex;
        }

        .menu-toggle {
          display: block;
        }

        .navbar ul.active li.has-dropdown .dropdown {
          display: none;
          position: static;
          background: rgba(6, 40, 104, 0.9);
        }

        .navbar ul.active li.has-dropdown.show .dropdown {
          display: block;
        }

        .navbar ul li.has-dropdown>a {
          display: flex;
          justify-content: space-between;
        }

        .navbar ul.active li.discord {
          text-align: center;
          margin-top: 20px;
        }

        .navbar ul.active li.discord a {
          display: inline-block;
        }

        .navbar ul.active li.discord a img {
          height: 40px;
        }

        .navbar .social {
          display: none;
        }
      }

      .hero {
        text-align: center;
        color: white;
        margin: 50px 20px;
        animation: fadeIn 1.5s ease-in-out;
      }

      .hero h1 {
        font-size: 2.5em;
        font-weight: bold;
        margin: 0;
      }

      .hero p {
        font-size: 1.2em;
        font-weight: bold;
        color: white;
        margin: 10px 0;
        background: none;
        border: none;
      }

      @keyframes fadeIn {
        from {
          opacity: 0;
        }

        to {
          opacity: 1;
        }
      }

      /* Hero Section Styling */
      .hero-section {
        text-align: center;
        margin: 50px auto;
        padding: 20px;
        color: white;
        font-family: 'Roboto', sans-serif;
        animation: fadeIn 1.5s ease-in-out;
      }

      .hero-section h1 {
        font-size: 3.5em;
        /* Increased font size */
        font-weight: bold;
        margin-bottom: 10px;
      }

      .hero-section p {
        font-size: 1.2em;
        margin: 5px 0;
      }

      .hero-section a {
        color: #2ea2cc;
        text-decoration: underline;
      }

      /* Image Links Section */
      .image-links {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 20px;
        margin: 50px auto;
        flex-wrap: wrap;
      }

      .image-card {
        text-align: center;
        position: relative;
        overflow: hidden;
        width: 180px;
        height: 180px;
        border-radius: 10px;
        background: rgba(9, 55, 144, 0.8);
        transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
        text-decoration: none;
        color: white;
      }

      .image-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 10px;
      }

      .image-card span {
        position: absolute;
        bottom: 10px;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 1em;
        font-weight: bold;
        background: rgba(0, 0, 0, 0.6);
        padding: 5px 0;
        transition: background 0.3s ease-in-out;
      }

      /* Hover Animation */
      .image-card:hover {
        transform: translateY(-5px) scale(1.05);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
      }

      .image-card:hover span {
        background: rgba(0, 0, 0, 0.8);
      }

      /* Trustpilot Review Section */
      .trustpilot-reviews {
        text-align: center;
        background: rgba(9, 55, 144, 0.1);
        padding: 40px 20px;
        margin: 40px auto;
      }

      .trustpilot-reviews h2 {
        font-size: 2em;
        margin-bottom: 20px;
        color: #ffffff;
        /* Change text color to white */
      }

      .review-container {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
        justify-content: center;
      }

      .review {
        background: #ffffff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 20px;
        width: 300px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        transition: transform 0.3s ease;
      }

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

      .review-header {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 10px;
      }

      .review-header img {
        height: 24px;
      }

      .review-name {
        font-weight: bold;
        color: #093790;
        flex-grow: 1;
      }

      .review-rating {
        color: #ffcc00;
      }

      .review-text {
        font-size: 0.9em;
        color: #555;
        line-height: 1.4;
      }

      /* Disable Sticky Navbar on PC */
      @media (min-width: 769px) {
        .navbar {
          position: static;
          /* Remove sticky behavior on larger screens */
        }
      }

      /* Payment Options Section */
      .payment-options {
        text-align: center;
        margin: 50px auto;
        padding: 20px;
        background: rgba(9, 55, 144, 0.1);
        border-radius: 10px;
      }

      .payment-options h2 {
        font-size: 2em;
        font-weight: bold;
        margin-bottom: 20px;
        color: #ffffff;
        /* White text */
      }

      .payment-icons {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 20px;
      }

      .payment-icon {
        width: 120px;
        height: 70px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #ffffff;
        border-radius: 8px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        transition: transform 0.3s ease-in-out;
      }

      .payment-icon img {
        max-width: 60%;
        max-height: 60%;
        object-fit: contain;
      }

      .payment-icon:hover {
        transform: translateY(-5px) scale(1.1);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
      }

      /* About Section Styling */
      .about-section {
        background: rgba(9, 55, 144, 0.1);
        /* Slight blue background */
        padding: 50px 20px;
        display: flex;
        justify-content: center;
        align-items: center;
      }

      .about-container {
        display: flex;
        align-items: center;
        gap: 30px;
        max-width: 1200px;
        margin: 0 auto;
      }

      .about-image {
        flex: 1;
        max-width: 500px;
      }

      .about-image img {
        width: 100%;
        height: auto;
        border-radius: 10px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
      }

      .about-text {
        flex: 1;
        font-family: 'Roboto', sans-serif;
        color: #fff;
      }

      .about-text h2 {
        font-size: 2em;
        margin-bottom: 10px;
        color: #ffffff;
      }

      .about-text p {
        font-size: 1em;
        line-height: 1.6;
        margin-bottom: 15px;
      }

      /* Responsive Design */
      @media (max-width: 768px) {
        .about-container {
          flex-direction: column;
          text-align: center;
        }

        .about-image,
        .about-text {
          max-width: 100%;
        }

        .about-text h2 {
          font-size: 1.8em;
        }

        .about-text p {
          font-size: 0.9em;
        }
      }

      /* Why Choose OSRS-PVM Section Styling */
      .why-choose-section {
        text-align: center;
        padding: 50px 20px;
        background: rgba(9, 55, 144, 0);
        /* Slight blue background */
        color: #ffffff;
      }

      .why-choose-section h2 {
        font-size: 2.5em;
        margin-bottom: 30px;
        font-weight: bold;
      }

      .why-choose-container {
        display: flex;
        justify-content: center;
        align-items: stretch;
        gap: 20px;
        flex-wrap: wrap;
        max-width: 1200px;
        margin: 0 auto;
      }

      .why-choose-box {
        background: rgba(9, 55, 144, 0.2);
        /* Solid blue box */
        border-radius: 10px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        text-align: center;
        padding: 20px;
        flex: 1;
        min-width: 250px;
        transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
      }

      .why-choose-box h3 {
        font-size: 1.5em;
        margin-bottom: 10px;
        color: #ffffff;
      }

      .why-choose-box p {
        font-size: 1em;
        color: #d0e6ff;
        /* Light blue text */
      }

      .why-choose-box:hover {
        transform: translateY(-5px) scale(1.05);
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
      }

      /* Responsive Design */
      @media (max-width: 768px) {
        .why-choose-container {
          flex-direction: column;
          gap: 15px;
        }

        .why-choose-box {
          min-width: 100%;
        }

        .why-choose-section h2 {
          font-size: 2em;
        }
      }

      /* Footer Section Styling */
      .footer {
        background: rgba(9, 55, 144, 0.4);
        /* Transparent Dark Blue Footer */
        color: white;
        padding: 40px 20px;
        font-family: 'Roboto', sans-serif;
        backdrop-filter: blur(5px);
        /* Slight blur effect for clarity */
      }

      /* Footer Container */
      .footer-container {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 30px;
        max-width: 1200px;
        margin: 0 auto;
      }

      /* Left Section */
      .footer-left {
        flex: 1;
        min-width: 280px;
      }

      .footer-left img {
        width: 150px;
        margin-bottom: 15px;
      }

      .footer-left p {
        font-size: 0.9em;
        line-height: 1.6;
        color: #d0e6ff;
      }

      /* Middle Section */
      .footer-middle {
        flex: 1;
        min-width: 280px;
        text-align: center;
      }

      .footer-middle h3 {
        font-size: 1.2em;
        margin-bottom: 10px;
        text-transform: uppercase;
        color: #ffffff;
      }

      .footer-middle ul {
        list-style: none;
        padding: 0;
        text-align: center;
      }

      .footer-middle ul li {
        margin-bottom: 8px;
      }

      .footer-middle ul li a {
        color: #d0e6ff;
        text-decoration: none;
        transition: color 0.3s ease;
      }

      .footer-middle ul li a:hover {
        color: #2ea2cc;
      }

      /* Right Section */
      .footer-right {
        flex: 1;
        min-width: 280px;
        text-align: right;
      }

      .footer-right h3 {
        font-size: 1.2em;
        margin-bottom: 10px;
        text-transform: uppercase;
        color: #ffffff;
      }

      .footer-right p {
        font-size: 0.9em;
        line-height: 1.6;
        color: #d0e6ff;
        margin-bottom: 15px;
      }

      .footer-right h4 {
        font-size: 1em;
        margin-top: 20px;
        color: #ffffff;
      }

      .footer-social {
        margin-top: 10px;
        text-align: center;
        /* Center social icons on mobile */
      }

      .footer-social a {
        display: inline-block;
        margin: 5px;
        transition: transform 0.3s ease;
      }

      .footer-social img {
        width: 24px;
        height: 24px;
      }

      .footer-social a:hover {
        transform: scale(1.1);
      }

      /* Bottom Section */
      .footer-bottom {
        text-align: center;
        margin-top: 30px;
        font-size: 0.8em;
        color: #d0e6ff;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        padding-top: 20px;
        background: transparent;
        /* Fully Transparent */
        backdrop-filter: none;
        /* Remove any blur effect */
      }

      /* Responsive Design */
      @media (max-width: 768px) {
        .footer-container {
          flex-direction: column;
          text-align: center;
          align-items: center;
          gap: 20px;
        }

        .footer-left,
        .footer-middle,
        .footer-right {
          text-align: center;
          margin-bottom: 20px;
        }

        .footer-left img {
          margin: 0 auto 10px;
        }

        .footer-middle ul {
          text-align: center;
        }

        .footer-right h3,
        .footer-right p {
          text-align: center;
        }

        .footer-social {
          text-align: center;
          margin-top: 10px;
        }
      }

      .centered-gif {
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 40px 0;
        /* Add space around the GIF */
        text-align: center;
      }

      .centered-gif img {
        max-width: 100%;
        height: auto;
        display: block;
        border-radius: 8px;
        /* Optional: adds rounded corners */
        transition: transform 0.3s ease-in-out;
      }

      .centered-gif img:hover {
        transform: scale(1.05);
        /* Slight zoom on hover */
      }

      /* Services Section */
      .services-section {
        text-align: center;
        padding: 40px 20px;
        background: rgba(9, 55, 144, 0.2);
        border-radius: 10px;
        max-width: 900px;
        margin: 50px auto;
      }

      .services-section h2 {
        font-size: 2em;
        margin-bottom: 20px;
        color: white;
      }

      /* Services Grid */
      .services-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        /* 3 columns */
        gap: 20px;
        justify-items: center;
        margin-top: 20px;
      }

      .service-card {
        text-align: center;
        position: relative;
        overflow: hidden;
        width: 200px;
        height: 200px;
        border-radius: 10px;
        background: rgba(9, 55, 144, 0.6);
        transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
        cursor: pointer;
        color: white;
      }

      .service-card img {
        width: 100%;
        height: 140px;
        object-fit: cover;
        border-radius: 10px 10px 0 0;
      }

      .service-card p {
        margin: 10px 0;
        font-size: 1em;
        font-weight: bold;
      }

      /* Popup Modal */
      .service-modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.8);
        justify-content: center;
        align-items: center;
        z-index: 10000;
      }

      .service-modal-content {
        background: rgba(9, 55, 144, 0.95);
        padding: 30px;
        border-radius: 10px;
        text-align: left;
        color: white;
        max-width: 400px;
        width: 90%;
        animation: fadeIn 0.3s ease-in-out;
      }

      .service-modal-content h3 {
        font-size: 1.5em;
        margin-bottom: 15px;
      }

      .service-modal-content ul {
        list-style: none;
        padding: 0;
        margin-bottom: 20px;
      }

      .service-modal-content ul li {
        margin-bottom: 10px;
        display: flex;
        align-items: center;
        gap: 10px;
      }

      .service-modal-content input[type="checkbox"] {
        transform: scale(1.2);
      }

      .buy-now-btn {
        display: block;
        width: 100%;
        padding: 10px;
        font-size: 1em;
        font-weight: bold;
        color: white;
        background: #2ea2cc;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        text-align: center;
      }

      .buy-now-btn:hover {
        background: #1f6bb5;
      }

      /* Close Button */
      .close-btn {
        position: absolute;
        top: 10px;
        right: 15px;
        font-size: 1.5em;
        cursor: pointer;
        color: white;
      }

      /* Responsive Adjustments */
      @media (max-width: 768px) {
        .services-grid {
          grid-template-columns: repeat(2, 1fr);
          /* Switch to 2 columns */
        }
      }

      @media (max-width: 480px) {
        .services-grid {
          grid-template-columns: 1fr;
          /* Single column on small devices */
        }
      }

      /* Services Section Styling */
      .services-section {
        text-align: center;
        padding: 40px 20px;
        font-family: 'Roboto', sans-serif;
        background: rgba(9, 55, 144, 0.1);
      }

      .services-section h2 {
        font-size: 2.5em;
        margin-bottom: 20px;
        color: white;
      }

      /* Services Grid */
      .services-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        margin-top: 20px;
      }

      /* Service Card */
      .service-card {
        text-align: center;
        background: rgba(9, 55, 144, 0.3);
        border-radius: 10px;
        overflow: hidden;
        cursor: pointer;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        position: relative;
      }

      /* Service Card Image */
      .service-card img {
        width: 100%;
        height: 150px;
        object-fit: cover;
        border-bottom: 2px solid #2ea2cc;
      }

      /* Service Card Text */
      .service-card p {
        margin: 10px 0;
        font-size: 1.1em;
        font-weight: bold;
        color: white;
      }

      /* Hover Animation */
      .service-card:hover {
        transform: translateY(-5px) scale(1.05);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
      }

      /* Add a subtle background glow */
      .service-card:hover::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 10px;
        box-shadow: 0 0 15px #2ea2cc;
        z-index: -1;
        animation: glow 1.5s infinite alternate;
      }

      /* Glow Animation Keyframes */
      @keyframes glow {
        from {
          box-shadow: 0 0 10px #2ea2cc;
        }

        to {
          box-shadow: 0 0 25px #2ea2cc;
        }
      }

      .service-card {
        display: block;
        text-decoration: none;
        /* Remove default link underline */
        color: inherit;
        /* Inherit text color */
      }

      /* Preloader Animation */
      #preloader {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #093790;
        /* Change to your theme color */
        z-index: 9999;
        display: none;
        opacity: 1;
        transition: opacity 0.5s ease-in-out;
      }

      /* Fade-in Animation for Pages */
      body {
        animation: fadeIn 0.8s ease-in-out;
      }

      @keyframes fadeIn {
        from {
          opacity: 0;
        }

        to {
          opacity: 1;
        }
      }

      /* Diary Section Styling */
      .diary-section {
        text-align: center;
        padding: 40px 20px;
        background: rgba(9, 55, 144, 0.2);
        /* Transparent Blue Background */
        border-radius: 8px;
        margin: 20px auto;
        max-width: 900px;
      }

      /* Diary Title */
      .diary-section h2 {
        font-size: 1.8em;
        color: white;
        margin-bottom: 20px;
      }

      /* Each Diary Row */
      .diary-row {
        display: flex;
        flex-direction: column;
        gap: 10px;
      }

      /* Individual Diary Item */
      .diary-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        background: rgba(255, 255, 255, 0.1);
        /* Slight transparency */
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 5px;
        transition: transform 0.2s ease-in-out;
      }

      .diary-item:hover {
        transform: translateY(-3px);
        background: rgba(255, 255, 255, 0.15);
        /* Slight hover effect */
      }

      /* Left-Aligned Difficulty */
      .difficulty {
        font-weight: bold;
        font-size: 1em;
        color: #ffffff;
        text-align: left;
        flex: 1;
      }

      /* Center-Aligned Prices */
      .prices {
        font-size: 0.9em;
        color: #d0e6ff;
        text-align: center;
        flex: 1;
      }

      /* Right-Aligned Checkbox */
      .diary-item input[type="checkbox"] {
        transform: scale(1.2);
        cursor: pointer;
      }

      /* Buy Button */
      .submit-btn {
        margin-top: 20px;
        padding: 10px 20px;
        font-size: 1em;
        font-weight: bold;
        cursor: pointer;
        border: none;
        border-radius: 5px;
        background: #2ea2cc;
        color: white;
        transition: background 0.3s;
      }

      .submit-btn:hover {
        background: #1f6bb5;
      }

      /* Responsive Adjustments */
      @media (max-width: 768px) {
        .diary-container {
          grid-template-columns: 1fr;
          /* One column on smaller screens */
        }
      }

      /* General Diaries Section Styling */
      .diaries-section {
        padding: 40px 20px;
        background: rgba(9, 55, 144, 0.2);
        border-radius: 10px;
        margin: 50px auto;
        max-width: 1200px;
        color: white;
        text-align: center;
      }
    </style>
    <div id="preloader"></div>
    <script>
      document.addEventListener('DOMContentLoaded', () => {
        const preloader = document.getElementById('preloader');
        // Smooth Page Exit
        document.querySelectorAll('a.smooth-link').forEach(link => {
          link.addEventListener('click', function(e) {
            e.preventDefault();
            const href = this.getAttribute('href');
            preloader.style.display = 'block';
            setTimeout(() => {
              window.location.href = href;
            }, 500); // Matches transition time
          });
        });
        // Smooth Page Load
        window.addEventListener('pageshow', () => {
          preloader.style.opacity = '0';
          setTimeout(() => {
            preloader.style.display = 'none';
          }, 500);
        });
      });
    </script>
    <script>
      function toggleMenu() {
        const menu = document.querySelector('.navbar ul');
        const toggle = document.querySelector('.menu-toggle');
        menu.classList.toggle('active');
        toggle.classList.toggle('active');
      }

      function toggleDropdown(event) {
        if (event.target.closest('li').classList.contains('has-dropdown')) {
          event.target.closest('li').classList.toggle('show');
        }
      }
    </script>
  </head>
  <body>
    <nav class="navbar">
      <div class="logo">
        <a href="./index.html">
          <img src="website_logo_transparent.png" alt="OSRS Services Logo">
        </a>
      </div>
      <div class="menu-toggle" onclick="toggleMenu()">☰</div>
      <ul onclick="toggleDropdown(event)">
        <li>
          <a href="./gold-items.html">OSRS Gold</a>
        </li>
        <li>
          <a href="./accounts.html">Accounts</a>
        </li>
        <li>
          <a href="./infernal-cape.html">Infernal Cape</a>
        </li>
        <li>
          <a href="./megascales.html">Megascales</a>
        </li>
        <li>
          <a href="./services.html">Services</a>
        </li>
      </ul>
      <ul>
        <li class="discord">
          <a href="https://discord.com/invite/osrspvmer" target="_blank">
            <img src="Discord.png" alt="Discord">
          </a>
        </li>
      </ul>
    </nav>
	
    <!-- Diary Section -->
    <section class="diary-section">
      <center>
        <a href="diaries.html" class="service-card">
          <img src="diaries.png" alt="Diaries">
          <p>Diaries</p>
        </a>
      </center>
	        <!-- Buy Now Button -->
      <button class="submit-btn" onclick="buyDiary()">Buy Now</button>
      <br>
      <br>
      <h2>Karamja Diary</h2>
      <div class="diary-container">
        <div class="diary-item">
          <span class="difficulty">Easy</span>
          <span class="prices" data-gp="7">7M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Medium</span>
          <span class="prices" data-gp="15">15M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Hard</span>
          <span class="prices" data-gp="13">13M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Elite</span>
          <span class="prices" data-gp="7">7M / $0.00</span>
          <input type="checkbox">
        </div>
      </div>
      <h2>Lumbridge & Draynor Diary</h2>
      <div class="diary-container">
        <div class="diary-item">
          <span class="difficulty">Easy</span>
          <span class="prices" data-gp="7">7M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Medium</span>
          <span class="prices" data-gp="10">10M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Hard</span>
          <span class="prices" data-gp="9">9M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Elite</span>
          <span class="prices" data-gp="9">9M / $0.00</span>
          <input type="checkbox">
        </div>
      </div>
      <!-- Ardougne Diary -->
      <h2>Ardougne Diary</h2>
      <div class="diary-container">
        <div class="diary-item">
          <span class="difficulty">Easy</span>
          <span class="prices" data-gp="5">5M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Medium</span>
          <span class="prices" data-gp="10">10M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Hard</span>
          <span class="prices" data-gp="10">10M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Elite</span>
          <span class="prices" data-gp="10">10M / $0.00</span>
          <input type="checkbox">
        </div>
      </div>
      <!-- Falador Diary -->
      <h2>Falador Diary</h2>
      <div class="diary-container">
        <div class="diary-item">
          <span class="difficulty">Easy</span>
          <span class="prices" data-gp="7">7M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Medium</span>
          <span class="prices" data-gp="10">10M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Hard</span>
          <span class="prices" data-gp="10">10M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Elite</span>
          <span class="prices" data-gp="8">8M / $0.00</span>
          <input type="checkbox">
        </div>
      </div>
      <!-- Desert Diary -->
      <h2>Desert Diary</h2>
      <div class="diary-container">
        <div class="diary-item">
          <span class="difficulty">Easy</span>
          <span class="prices" data-gp="6">6M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Medium</span>
          <span class="prices" data-gp="7.5">7.5M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Hard</span>
          <span class="prices" data-gp="10">10M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Elite</span>
          <span class="prices" data-gp="7">7M / $0.00</span>
          <input type="checkbox">
        </div>
      </div>
      <!-- Fremennik Diary -->
      <h2>Fremennik Diary</h2>
      <div class="diary-container">
        <div class="diary-item">
          <span class="difficulty">Easy</span>
          <span class="prices" data-gp="5">5M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Medium</span>
          <span class="prices" data-gp="10">10M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Hard</span>
          <span class="prices" data-gp="10">10M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Elite</span>
          <span class="prices" data-gp="17">17M / $0.00</span>
          <input type="checkbox">
        </div>
      </div>
      <!-- Kandarin Diary -->
      <h2>Kandarin Diary</h2>
      <div class="diary-container">
        <div class="diary-item">
          <span class="difficulty">Easy</span>
          <span class="prices" data-gp="5">5M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Medium</span>
          <span class="prices" data-gp="10">10M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Hard</span>
          <span class="prices" data-gp="13">13M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Elite</span>
          <span class="prices" data-gp="8">8M / $0.00</span>
          <input type="checkbox">
        </div>
      </div>
      <!-- Kourend & Kebos Diary -->
      <h2>Kourend & Kebos Diary</h2>
      <div class="diary-container">
        <div class="diary-item">
          <span class="difficulty">Easy</span>
          <span class="prices" data-gp="6">6M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Medium</span>
          <span class="prices" data-gp="10">10M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Hard</span>
          <span class="prices" data-gp="12">12M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Elite</span>
          <span class="prices" data-gp="25">25M / $0.00</span>
          <input type="checkbox">
        </div>
      </div>
      <!-- Morytania Diary -->
      <h2>Morytania Diary</h2>
      <div class="diary-container">
        <div class="diary-item">
          <span class="difficulty">Easy</span>
          <span class="prices" data-gp="8">8M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Medium</span>
          <span class="prices" data-gp="12">12M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Hard</span>
          <span class="prices" data-gp="12">12M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Elite</span>
          <span class="prices" data-gp="9">9M / $0.00</span>
          <input type="checkbox">
        </div>
      </div>
      <!-- Western Provinces Diary -->
      <h2>Western Provinces Diary</h2>
      <div class="diary-container">
        <div class="diary-item">
          <span class="difficulty">Easy</span>
          <span class="prices" data-gp="8">8M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Medium</span>
          <span class="prices" data-gp="11">11M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Hard</span>
          <span class="prices" data-gp="13">13M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Elite</span>
          <span class="prices" data-gp="10">10M / $0.00</span>
          <input type="checkbox">
        </div>
      </div>
      <!-- Wilderness Diary -->
      <h2>Wilderness Diary</h2>
      <div class="diary-container">
        <div class="diary-item">
          <span class="difficulty">Easy</span>
          <span class="prices" data-gp="7">7M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Medium</span>
          <span class="prices" data-gp="9">9M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Hard</span>
          <span class="prices" data-gp="17">17M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Elite</span>
          <span class="prices" data-gp="20">20M / $0.00</span>
          <input type="checkbox">
        </div>
      </div>
      <!-- Varrock Diary -->
      <h2>Varrock Diary</h2>
      <div class="diary-container">
        <div class="diary-item">
          <span class="difficulty">Easy</span>
          <span class="prices" data-gp="10.56">10.56M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Medium</span>
          <span class="prices" data-gp="16.11">16.11M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Hard</span>
          <span class="prices" data-gp="17.78">17.78M / $0.00</span>
          <input type="checkbox">
        </div>
        <div class="diary-item">
          <span class="difficulty">Elite</span>
          <span class="prices" data-gp="8.89">8.89M / $0.00</span>
          <input type="checkbox">
        </div>
      </div>
      <!-- ✅ Total Price Display -->
      <p>Total Price: $ <span id="total-price">0.00</span>
      </p>
      <!-- Buy Now Button -->
      <button class="submit-btn" onclick="buyDiary()">Buy Now</button>
    </section>
    <script>
// ✅ Fetch Gold Price and Update Diary Prices
async function fetchGoldPrice() {
    try {
        const response = await fetch('https://raw.githubusercontent.com/GeneralBacuum/test/refs/heads/main/prices.json');
        const data = await response.json();

        if (!data.sell_price) {
            throw new Error('Sell price is missing in the JSON.');
        }

        const sellPrice = parseFloat(data.sell_price); // Ensure it's a float

        document.querySelectorAll('.diary-item .prices').forEach(span => {
            const gpValue = parseFloat(span.getAttribute('data-gp')); // Get gold amount in millions
            const usdValue = (gpValue * sellPrice).toFixed(2); // Calculate USD price
            span.textContent = `${gpValue}M / $${usdValue}`; // Update display
            span.dataset.usd = usdValue; // Store USD value for calculations
        });

        calculateTotal(); // Recalculate the total after prices are updated
    } catch (error) {
        console.error('❌ Error fetching gold price:', error);
        alert('Failed to fetch gold prices. Please try again later.');
    }
}

// ✅ Calculate Total Price Based on Selected Tasks
function calculateTotal() {
    let total = 0;

    document.querySelectorAll('.diary-item input[type="checkbox"]:checked').forEach(checkbox => {
        const price = parseFloat(checkbox.previousElementSibling.dataset.usd || '0');
        total += price;
    });

    document.getElementById('total-price').textContent = total.toFixed(2); // Update total in USD
}

// ✅ Send Selected Diaries to Live Chat with Correct `H2` Grouping
function buyDiary() {
    const selectedDiaries = {};

    document.querySelectorAll('.diary-item input[type="checkbox"]:checked').forEach(checkbox => {
        const diaryItem = checkbox.closest('.diary-item');
        const difficulty = diaryItem.querySelector('.difficulty').innerText;
        const price = diaryItem.querySelector('.prices').innerText;

        // ✅ Get the closest preceding <h2> for the current diary section
        let parentSection = diaryItem.closest('.diary-container');
        let diaryTitle = parentSection.previousElementSibling;

        while (diaryTitle && diaryTitle.tagName !== 'H2') {
            diaryTitle = diaryTitle.previousElementSibling;
        }

        diaryTitle = diaryTitle ? diaryTitle.innerText : 'Unknown Diary';

        // Group tasks under their diary title
        if (!selectedDiaries[diaryTitle]) {
            selectedDiaries[diaryTitle] = [];
        }

        selectedDiaries[diaryTitle].push(`${difficulty} - ${price}`);
    });

    // ✅ Build the final message
    if (Object.keys(selectedDiaries).length > 0) {
        let message = `I would like to purchase the following Diaries:\n\n`;

        for (const [diaryTitle, tasks] of Object.entries(selectedDiaries)) {
            message += `${diaryTitle}:\n`;
            tasks.forEach(task => {
                message += `- ${task}\n`;
            });
            message += `\n`; // Add an extra new line after each diary
        }

        const totalPrice = document.getElementById('total-price').innerText;
        message += `Total Price: $${totalPrice}`;

        // ✅ Send Message via Smartsupp Live Chat
        if (window.smartsupp) {
            smartsupp('chat:open');
            smartsupp('chat:message', message);
            console.log('✅ Message sent to Live Chat:', message);
        } else {
            console.error('❌ Smartsupp not initialized.');
            alert('LiveChat is not ready. Please try again later.');
        }
    } else {
        alert('⚠️ Please select at least one task before proceeding.');
    }
}

// ✅ Add Event Listener to Checkboxes for Real-time Total Calculation
document.querySelectorAll('.diary-item input[type="checkbox"]').forEach(checkbox => {
    checkbox.addEventListener('change', calculateTotal);
});

// ✅ Fetch Prices on Page Load
document.addEventListener('DOMContentLoaded', () => {
    fetchGoldPrice();
});

    </script>
    <br>
    <br>
    <br>
    <footer class="footer">
      <div class="footer-container">
        <!-- Left Section: Logo and Description -->
        <div class="footer-section footer-left">
          <img src="website_logo_transparent.png" alt="OSRS Services Logo">
          <p> Providing efficient and affordable OSRS Services, we have completed over $250,000 in orders across numerous sites. Speak to Live Chat if you need any support. </p>
        </div>
        <!-- Middle Section: Help and Links -->
        <div class="footer-section footer-middle">
          <h3>Quick Links</h3>
          <ul>
            <li>
              <a href="./contact.html"></a>
            </li>
            <li>
              <a href="./blog.html"></a>
            </li>
            <li>
              <a href="./privacy.html"></a>
            </li>
            <li>
              <a href="https://discord.com/invite/osrspvmer">Discord</a>
            </li>
            <li>
              <a href="https://www.eldorado.gg/users/OSRSServicesPvM?tab=Feedback">Eldorado</a>
            </li>
            <li>
              <a href="https://www.sythe.org/threads/osrs-services-vouch-thread/#post-11617726">Sythe</a>
            </li>
            <li>
              <a href="https://uk.trustpilot.com/review/osrs-pvm.com">Trustpilot</a>
            </li>
          </ul>
        </div>
        <div class="footer-section footer-right">
          <h3>Our Commitment</h3>
          <p> Dedicated to offering secure and efficient OSRS services. Our team operates with professionalism and transparency, ensuring customer satisfaction. </p>
          <h4>Join our Discord <a href="https://discord.com/invite/osrspvmer">
              <img src="Discord.png" alt="Discord">
            </a>
          </h4>
        </div>
      </div>
      <div class="footer-bottom">
        <p>© 2025 OSRS Services. All rights reserved.</p>
      </div>
    </footer>
    <script src="chat.js"></script>
    <script src="script.js"></script>
  </body>
</html>