@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700&display=swap');

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: #2C8DEB;
    display: flex;
    height: 100vh;
    flex-direction: column;
    padding: 12px 2px;
}
.flex{
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.container {
    display: flex;
    width: 100%;
    flex: 1;
}

img {
    height: 80px;
}

a{
    text-decoration: none;
    color: #007bff;
}
a:hover{
    font-weight: 700;
    transition: ease-in-out 3s;
}
.sidebar {
    background: #2c3e50;
    color: white;
    width: 250px;
    height: 150vh;
    transition: all 0.3s ease-in-out;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar a {
    display: flex;
    align-items: center;
    padding: 15px 10px;
    text-decoration: none;
    color: white;
    font-size: 16px;
    transition: background 0.3s ease, font-size 0.3s ease;
}

.sidebar a:hover {
    background: #34495e;
}

.sidebar i {
    font-size: 25px;
    min-width: 40px;
    text-align: center;
    color: white;
}

.label {
    transition: opacity 0.3s, width 0.3s ease;
}

.sidebar.collapsed .label {
    opacity: 0;
    width: 0;
}

.logo {
    background: #1a252f;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    padding: 10px 0;
}

.nav-item.active {
    background: #2980b9;
}

.settings {
    margin-top: auto;
    border-top: 1px solid #34495e;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

header {
    background: white;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#toggleSidebar {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    margin-right: 15px;
}

main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.calculator-container {
    max-width: 500px;
    width: 90%;
    margin: 20px auto;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.display {
    background: #e5e7eb;
    padding: 15px;
    font-size: 18px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.btn {
    padding: 12px;
    font-size: 16px;
    background: lightgray;
    cursor: pointer;
    border-radius: 5px;
    transition: transform 0.3s;
}

.btn:hover {
    transform: scale(1.05);
}

.enter {
    background: #1e3a8a;
    color: white;
}

.clear {
    background-color: #eb3939;
    color: white;
}

.mode-btn {
    padding: 10px 16px;
    margin: 4px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid #007bff;
    background-color: #ffffff;
    color: #007bff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .mode-btn:hover {
    background-color: #007bff;
    color: #ffffff;
  }
  
  .mode-btn.active {
    background-color: #0056b3;
    color: #ffffff;
    border-color: #0056b3;
  }
  

#loanResult {
    text-align: center;
    margin-top: 20px;
}

#viewRepaymentBtn {
    margin-top: 10px;
    display: block;
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}

#repaymentScheduleContainer {
    padding:15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    max-width: 700px;
    margin:20px auto;
}


#repaymentScheduleTable th, #repaymentScheduleTable td,
#loanComparisonTable th, #loanComparisonTable td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    background: #f9f9f9;
    
}
.close{
    margin: 15px 0px;
}
#closeResult,
.btn2 {
    margin-top: 10px;
    padding: 8px 15px;
    font-size: 18px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#closeResult:hover {
    background-color: #0056b3;
}

.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}


/* FAQ Section */
.faq-section {
    margin: 30px 0;
    padding: 20px;
    background: #f9fbfd;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.faq-section h2, .related-links h2 {
    font-size: 1.6rem;
    margin-bottom: 15px;
    color: #0056b3;
    text-align: center;
}

/* FAQ Items */
.faq {
    margin-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.faq-question {
    width: 100%;
    background: none;
    color: #007bff;
    padding: 12px;
    border: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.faq-question:hover {
    color: #003d82;
}

.faq-question .icon {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.faq-answer {
    display: none;
    padding: 12px;
    border-left: 4px solid #007bff;
    margin-top: 5px;
    background: white;
    font-size: 1rem;
    color: #333;
    transition: max-height 0.3s ease-in-out;
}

/* Related Links Section */
.related-links {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.related-links ul {
    list-style: none;
    padding: 0;
}

.related-links li {
    margin-bottom: 8px;
    font-size: 1rem;
}

.related-links a {
    color: #007bff;
    font-weight: bold;
    text-decoration: none;
}

.related-links a:hover {
    text-decoration: underline;
    color: #003d82;
}

.close:hover {
    color: red;
}


.affiliate-link {
    display: inline-block;
    background-color: #00b37e;
    color: #fff;
    font-weight: bold;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 10px;
}

.affiliate-link:hover {
    background-color: #019f70;
    transform: translateY(-2px);
    text-decoration: none;
}

.affiliate-link:active {
    transform: translateY(1px);
}


.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: none;                    /* Use display none instead of .hidden for overlay */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.1rem;
    gap: 15px;
}

#loadingOverlay.show {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Keep your existing .hidden if used elsewhere */
.hidden {
    display: none !important;
}


.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .affiliate-banner.blueberry-banner {
    width: 450px;
    height: 115px;
    margin: 5px auto;
    background: linear-gradient(90deg, #e0f7ff, #dbeafe);
    border: 2px solid #3b82f6;
    border-radius: 10px;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', sans-serif;
  }
  
  .affiliate-banner .affiliate-cta {
    margin: 5px 0;
    font-size: 14px;
    color: #1e3a8a;
    font-weight: 500;
  }
  
  .affiliate-btn-banner {
    margin: 5px 0;
    padding: 6px 12px;
    background-color: #3b82f6;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    display: inline-block;
    width: fit-content;
    transition: background-color 0.3s ease;
  }
  
  .affiliate-btn-banner:hover {
    background-color: #1e40af;
  }
  
  .berry{
    border: 4px solid #A6BFF1;
  }
  .aberry{
    background-color: #4F86F7;
  }
  .aberry:hover{
    background-color: #496898;
  }
.error{
    color: red;
}
/* Responsive Styles - Mobile First */

/* General Mobile Styles (applies to all sizes below 1024px) */
@media (max-width: 1024px) {
    body{
        padding: 15px 0px;
    }
    .sidebar {
        width: 120px;
        place-items: center;
    }

    .sidebar i {
        font-size: x-large;
        margin: 25px 0;
        color: white;
    }
    .sidebar{
        height: 100vh;
    }

    .btn{
        padding: 13px;
        font-size: 30px;
    }
    .btn2{
        padding: 15px;
        font-size: 40px;
        margin: 5px;
    }

    .sidebar a {
        padding: 10px;
        font-size: 14px;
    }
    .result{
        font-size: 40px;
        padding: 8px 0px;
    }
   
    .label {
        display: none;
    }
     .flex{
        flex-direction: column;
     }
    #toggleSidebar {
        display: none;
    }
    #closeResult {
    font-size: 24px;
    }
    .calculator-container {
        height: auto;
        max-width: 1200px;
    }

    .display {
        padding: 65px;
        font-size: 35px;
        margin-bottom: 40px;
    }
    
    .description{
        font-size: 30px;
    }
    #calculatorButtons {
        height: 520px;
        margin: 8px;
        gap: 25px;
    }

    #repaymentScheduleTable th, #repaymentScheduleTable td,
    #loanComparisonTable th, #loanComparisonTable td{
        font-size:35px;    
     }
    .modal-content{
    margin: 60% auto;
  }

.faq-question{
    font-size: 40px;
}

.faq-answer{
  font-size: 27px;
  }

.affiliate-link{
    padding: 25px 15px;
}
  .wise-tip {
    padding: 53px 36px;
    font-size: 33px;
    max-width: 55%;
    bottom: 15px;
    right: 15px;
    border-width: 3px;
    border-radius: 16px;
  }

  .wise-tip .close-tip {
    font-size: 42px;
    top: 8px;
    right: 12px;
  }

  .affiliate-link {
    padding: 14px 20px;
    font-size: 16px;
    border-radius: 10px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
  }

  .wise-tip a.affiliate-link {
    font-size: 16px;
  }
  .affiliate-banner.blueberry-banner {
    width: 650px;
    height:120px ;
    margin: 10px auto;
    text-align: left;
  }
 
}

/* Tablet */
@media (max-width: 768px) {
    body {
        padding: 12px 0px;
        flex-direction: column;
    }
   .flex
   {
    flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        justify-content: space-around;
    }
    .result{
        font-size: 50px;
    }
    .sidebar a {
        flex-direction: column;
        padding: 10px;
        font-size: 18px;
    }
    #closeResult {
    font-size: 24px;
    }
    .main-content {
        padding: 10px;
    }
    .btn{
        padding: 15px;
        font-size: 35px; 
    }
    .btn2 {
        padding: 15px;
        font-size: 36px;
    }

    .description{
        font-size:32px;
    }
    .calculator-container {
        padding: 25px;
        height: auto;
    }

    .buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    #calculatorButtons {
        padding: 130px;
        height: 700px;
    }

    #repaymentScheduleTable th, #repaymentScheduleTable td,
    #loanComparisonTable th, #loanComparisonTable td{
        font-size:30px;    
}
}

/* Mobile Phones */
@media (max-width: 480px) {
    .calculator-container {
        width: 95%;
        height: auto;
        margin: 20px auto;
        padding: 20px;
    }

    .display {
        font-size: 16px;
        padding: 15px;
    }

    .buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .btn{
        padding: 15px;
        font-size: 30px;
    }
    .btn2 {
        padding: 15px;
        font-size: 56px;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
    }
    .description{
        font-size: larger;
    }
    
    #repaymentScheduleTable th, #repaymentScheduleTable td,
    #loanComparisonTable th, #loanComparisonTable td{
   font-size: 25px;
   background-color: #f9f9f9;
}

    #closeResult {
        font-size: 12px;
        padding: 6px 10px;
    }
}



/* Mobile adjustments */
@media screen and (max-width: 600px) {
   .close {
        font-size: 24px;
        right: 10px;
    }
}


/* Default Currency Calculator Styles */
.currency-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* Default 3 buttons per row */
    gap: 8px;
    justify-items: center;
    width: 100%;
    margin: 10px 0;
}

.currency-btn {
    padding: 20px;
    font-size: 18px;
    background: lightgray;
    cursor: pointer;
    border-radius: 5px;
    transition: transform 0.3s;
    width: 100%;
}

.currency-btn:hover {
    transform: scale(1.05);
}

.currency-enter {
    background: #1e3a8a;
    color: white;
}

.currency-clear {
    background-color: #eb3939;
    color: white;
}

/* Mobile Phones */
@media (max-width: 480px) {
    .currency-buttons {
        grid-template-columns: repeat(2, 1fr); /* 2 buttons per row on mobile */
        gap: 10px;
    }

    .currency-btn {
        padding: 15px;
        font-size: 22px; /* Smaller buttons */
    }
    }
    

/* Tablet */
@media (max-width: 768px) {
    .currency-buttons {
        grid-template-columns: repeat(5, 1fr); /* 5 buttons per row */
        gap: 10px;
    }

    .currency-btn {
        padding: 15px;
        font-size: 20px; /* Slightly larger font size for tablets */
    }
}

/* General adjustments for all mobile/tablet views */
@media (max-width: 1024px) {
    .currency-buttons {
        grid-template-columns: repeat(5, 1fr); /* 5 buttons in a row for tablets */
        gap: 10px;
    }

    .currency-btn {
        padding: 12px;
        font-size: 16px;
    }
}

