/* Font imports moved to individual page files for better control */
:root {
    --color1: #FF9EAA; /* Bubblegum pink */
    --color2: #8FD3FF; /* Sky blue */
    --color3: #FFE08F; /* Lemon yellow */
    --color4: #B5FF8F; /* Mint green */
    --color5: #f3810b;
}

* {
    box-sizing: border-box;
}

/* Custom Overlay Scrollbar - Prevents layout shift */
/* Overlay scrollbar that doesn't take up space */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
    -webkit-border-radius: 0;
    border-radius: 0;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    -webkit-border-radius: 10px;
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
}

/* Firefox overlay scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
}

/* Prevent scrollbar from taking up space - use overlay mode */
html {
    overflow-y: overlay; /* Overlay mode for supporting browsers */
    overflow-y: auto; /* Fallback for non-supporting browsers */
}

body {
    overflow-x: hidden; /* Prevent horizontal scrollbar */
}

/* Force overlay scrollbar behavior */
@supports (overflow: overlay) {
    html {
        overflow-y: overlay;
    }
}

/* Alternative: Use scrollbar-gutter for browsers that support it */
@supports (scrollbar-gutter: stable) {
    html {
        scrollbar-gutter: stable;
        overflow-y: auto;
    }
}





html {
    scroll-behavior: smooth;
    
}
@media screen and (min-width: 768px) {
    html {
        margin-right: -15px
    }
}

.container {
    max-width: 400px;  /* Fixed mobile width for all devices */
    width: 100%;
    margin: 10px auto 40px;
    padding: 0px;
}

/* Navbar Styles */
.navbar {
    /* background: white; */
    padding: 15px;
    border-radius: 30px;
    /* box-shadow: 0 10px 20px rgba(0,0,0,0.1); */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-button {
    width: 25%;
    background: var(--color2);
    border: none;
    padding: 10px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 2px;
    text-decoration: none;
    text-align: center;
}

.nav-button:hover {
    /* transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); */
}

/* Main Content */
body {
    min-height: 100vh;
    margin: 0;
}

/* Add a beige background behind the principles container */
.principles-bg {
    /* background: #fff3d6; */
    border-radius: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    padding: 15px;
    margin: 0px 0;
}

.principles-grid .principle-card {
    cursor: default;
    margin-bottom: 10px;
}

.principles-grid .principle-card .principle-content{
    width: 100%;
    text-align: left;
}

.profile-page .principle-card .principle-content{
    width: 100%;
    /* text-align: center; */
}
/* .principle-card:not(.pending) .principle-content {
    height: unset;
} */

.principle-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.principle-card-title p{
    margin: 5px;
}

.principle-card-title .title{
    font-size: 18px;
}

.principle-card p, .principle-card .time {
    font-size: 14px;
}


@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Prescription Page Styles */

.prescription-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

.prescription-content {
    background: white;
    padding: 20px;
    border-radius: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    margin-bottom: 40px;
    line-height: 1.8;
    /* font-size: 1.1rem; */
    font-size: 0.65rem;
    color: #333;
}

.prescription-content p {
    text-align: justify;
}

.prescription-content ul {
    margin: 15px 0;
    padding-left: 25px;
}

.prescription-content li {
    margin-bottom: 8px;
}

.download-btn{
    display: flex;
    width: 100%;
    justify-content: center;
}

/* Landing page specific styles */
.landing-title {
    font-size: 1.2rem;
    color: #4a90e2;
    text-align: center;
    margin-bottom: 0px;
    font-weight: bold;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #7dcf95 0%, #5fb3d3 100%);
    color: white;
}

.btn-accent {
    background: linear-gradient(135deg, #fdac62 0%, #ff6b6b 100%);
    color: white;
}

.prescription-image {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    margin: 20px 0;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
        gap: 10px;
    }
    
    .container {
        padding: 15px;
    }
    
    .principle-card {
        padding: 15px;
        min-height: auto;
    }
    
    .profile-main {
        flex-direction: column;
    }
    
    .profile-sidebar {
        margin-bottom: 20px;
    }
    
    .prescription-content {
        padding: 25px;
    }
}

.pagination {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.no-principles {
    font-style: italic;
    color: #999;
    padding: 10px 0;
}

@media (max-width: 768px) {
    .navbar {
        padding: 10px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .nav-button {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .title {
        font-size: 1.3rem;
    }

    .description {
        font-size: 0.95rem;
    }

    .two-columns {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }


    .principle-card-title .avatar {
        display: none;
    }

    .pagination {
        flex-direction: row;
        justify-content: center !important;
    }

    .container {
        padding: 0 5px;
        margin-top: 0;
    }

    .nav-button {
        font-size: 0.8rem;
        margin: 0 2px;
    }

    .navbar {
        border-radius: 15px;
    }

    .title {
        font-size: 1.2rem;
    }

    .description {
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .container,.profile-main {
        margin-left: 10px !important;
        margin-right: 10px !important;
        width: calc(100% - 20px) !important;
        padding: 0!important;
    }
    
    /* .nav-container.nav-flex {
        margin-left: 10px;
        margin-right: 10px;
        width: calc(100% - 20px);
    } */
}

.nav-auth {
    display: flex;
}

@media (max-width: 768px) {

    .nav-links, .nav-auth {
        display: none;
        flex-direction: column;
        width: 100%;
    }

    .nav-links a {
        width: auto;
    }

    .nav-links.show, .nav-auth.show {
        display: flex;
        gap: 10px;

    }


    .nav-auth .nav-button{
        margin-bottom: 10px;
        width: auto;
    }

    .principle-header{
        /* position: relative; */
    }

    .principle-header .principle-title{
        /* padding-top: 40px; */
        font-size: 0.95rem;
        width: 75%;
        flex: unset;
    }
   
    .principle-header .principle-meta{
        /* position: absolute; */
        /* right: 0; */
        /* font-size: 0.85rem; */
    }
    .principle-meta .time-ago{
        font-size: 0.65rem;
    }

}

/* --- Begin nav.css styles merged --- */
.main-nav {
    background: transparent;
    margin: 0;
    padding: 0;
    box-shadow: none;
}

.nav-container.nav-flex {
    max-width: 400px;  /* Fixed mobile width for all devices */
    width: 100%;
    margin: 0px auto 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-radius: 40px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    min-height: 55px;
}

.nav-left {
    display: flex;
    width: 100%;
}

.nav-left {
    gap: 0;
}

@media (max-width: 900px) {
    .container{
        margin-top: 0;
    }
    .nav-container.nav-flex {
        padding: 8px 10px;
    }
    .nav-left{
        /* gap: 10px; */
    }
    #logoutForm{
        top: 10px !important;
    }
} 
/* --- End nav.css styles merged --- */

.principle-number-label {
    font-weight: bold;
    color: #888;
    font-size: 0.75em;
    text-align: left;
}

.plus-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 2.5em;
    color: #bbb;
    margin-bottom: 2px;
    transition: color 0.2s;
}

.add-principle-label {
    color: #bbb;
    font-size: 1em;
    margin-bottom: 8px;
}

.add-principle-form {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.add-principle-form.active {
    display: flex;
}

.add-principle-title input {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #eee;
    font-size: 0.75em;
}

.add-principle-desc textarea {
    width: 100%;
    /* height: 60px; */
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #eee;
    font-size: 1em;
    resize: vertical;
}

.moderation-icon {
    padding: 0px;
    font-size: 0.95rem;
}

.principle-card {
    position: relative;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.empty-slot-container{
    width: 100%;
    height: 100%;
}

.plus-btn-full {
    background: transparent;
    border: none;
    color: #7dcf95;
    cursor: pointer;
    padding-right: 0;
}
.plus-btn-full .empty-icon {
    font-size: 2rem;
    display: block;
    margin: 0 auto;
    font-weight: bold;
    margin-bottom: 3px;
    line-height: 0;
}
.add-principle-form {
    display: block;
    width: 100%;
    height: 100%;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
    background: #f7f7f7;
    /* border: 2px solid #7dcf95; */
    border-radius: 14px;
    /* padding: 18px 16px 14px 16px; */
    animation: fadeIn 0.3s;
}
.add-principle-title,.add-principle-desc{
    width: 100%;
    margin-bottom: 8px;
}
.add-principle-desc{
    height: 55%;
}
.add-principle-desc textarea{
    height: 100%;
}
.add-principle-form.active {
    display: flex;
}
.add-principle-title input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1.5px solid lightgrey;
    font-size: 0.75em;
    background: #fff;
    transition: border-color 0.2s;
}
.add-principle-title input:focus {
    /* border-color: #7dcf95; */
    outline: none;
}
.add-principle-desc textarea {
    width: 100%;
    min-height: 290px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1.5px solid lightgrey;
    font-size: 0.75rem;
    background: #fff;
    resize: vertical;
    transition: border-color 0.2s;
}
.add-principle-desc textarea:focus {
    /* border-color: #7dcf95; */
    outline: none;
}
.add-principle-form .save-btn {
    background: #7dcf95;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s;
}
.add-principle-form.np__form .save-btn{
    float: right;
}
.edit-principle-form.ep__form .save-btn{
    float: right;
}
.edit-principle-form.ep__form .save-btn.pencil__icon{
    margin-right: 0;
}
.add-principle-form.np__form .save-btn.pencil__icon{
    margin-right: 0;
    margin-top: 0;
}
.ep__form .editTitleCount{
    display: none !important;
}
/* Remove air principle modal styles if present */
.air-principle-modal, .air-principle-modal * {
    display: none !important;
}

.principle-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 8px;
}
.principle-header.expanded{
    height: 100%;
}
.profile-page .principle-header{
    margin-top: 20px;
}
.profile-page .principle-header .principle-meta{
    flex-flow: column;
    top: 10px;
    gap: 5px;
}   
.principle-title {
    font-size: 1.4rem;
    color: #fff;
    margin: 0;
    font-weight: bold;
    flex: 1 1 auto;
    text-align: left;
}

.principle-meta {
    padding-top: 0px;
    text-align: right;
    font-size: 1rem;
    color: rgba(255,255,255,0.8);
    min-width: 120px;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 2px;
}
.principle-meta .meta-username {
    text-decoration: none;
    font-weight: bold;
    color: #fff;
    margin-bottom: 2px;
}

.time-ago {
    font-size: 0.98em;
    margin-top: 4.5px;
    margin-left: 4px;
}

.edit-profile-btn, #editProfileBtn {
    /* background: #7dcf95; */
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0;
    font-size: 0.90rem;
    font-weight: bold;
    cursor: pointer;
    /* margin-top: 10px;
    margin-right: 10px; */
    /* box-shadow: 0 2px 8px rgba(125,207,149,0.12); */
    transition: background 0.2s;
    outline: none;
    /* letter-spacing: 0.5px; */
}

#editProfileBtn{
    margin-right: 10px;
}
#saveProfileBtn{
    /* position: absolute;
    top: 10px;
    right: 15px;
    padding: 0; */
}

/* Profile page text fields styling */
.profile-field-row input[type="text"],
.profile-field-row input[type="email"],
.profile-field-row input[type="number"],
.profile-field-row input[type="password"] {
    width: 100%;
    padding: 8px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    background: #fafbfc;
    transition: all 0.3s ease;
    box-sizing: border-box;
    outline: none;
}

.profile-field-row input[type="text"]:focus,
.profile-field-row input[type="email"]:focus,
.profile-field-row input[type="number"]:focus,
.profile-field-row input[type="password"]:focus {
    border-color: #7dcf95;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(125, 207, 149, 0.1);
    transform: translateY(-1px);
}

/* Profile page buttons styling */
.profile-info-form.save-btn {
    background: none;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 5px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    /* margin-top:10px; */
    margin-right: 12px;
    transition: all 0.3s ease;
    /* box-shadow: 0 2px 8px rgba(125, 207, 149, 0.2); */
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.profile-info-block .profile-info-form.save-btn {
    background: transparent;
    padding-top: 0;
    padding-left: 0;
    margin-right: 0;
    font-size: 0.85rem;
    padding-right: 0;
}
.profile-info-form.cancel-btn{
    margin-top: 10px;
    background: none;
    font-size: 1.25rem;
    border: none;
}
/* Cancel button styling */
.profile-info-form .save-btn[style*="background:#e57373"],
.profile-info-form .save-btn[style*="background: #e57373"] {
    background: #e57373 !important;
    box-shadow: 0 2px 8px rgba(229, 115, 115, 0.2);
}

/* Responsive table wrapper */
.responsive-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

/* Responsive tables */
.profile-info-table, .walkers-table {
  /* min-width: 600px; */
  width: 100%;
}
.profile-info-table{
    /* padding-right: 15px; */
}

#profile-value-password .profile-edit-input{
    width: 49%;
}

@media (max-width: 700px) {
  .profile-info-table, .walkers-table {
    min-width: 0;
    width: 100%;
    font-size: 0.98rem;
  }
  .profile-info-table th, .profile-info-table td,
  .walkers-table th, .walkers-table td {
    padding: 8px 6px;
    font-size: 0.75rem;
  }
  .profile-info-block, .profile-principles-block, .walkers-container {
    padding: 10px 2vw;
    min-width: 0;
    box-sizing: border-box;
  }
  .principle-card, .placeholder-card {
    min-width: 0;
    max-width: 100vw;
    box-sizing: border-box;
    font-size: 0.98rem;
  }
  .principles-grid {
    gap: 8px;
  }
  body, html {
    overflow-x: hidden !important;
  }
}

/* Hide horizontal overflow everywhere */
body, html {
  overflow-x: hidden;
}

/* Mobile nav menu */
@media (min-width: 701px) {
    #mobileNavMenu{
        display: none;
    }
}

@media (max-width: 500px) {
  .profile-info-table, .walkers-table {
    font-size: 0.92rem;
  }
  .principle-card, .placeholder-card {
    font-size: 0.92rem;
  }
  
  .principle-card .principle-desc{
    font-size: 0.75rem;
  }
  .profile-page .principle-card .principle-desc{
    padding-right: 30px;
  }
  .principles-page .principles-grid .principle-card{
    min-height: 350px;
    padding: 15px;
    height: auto;
    max-height: unset;
  }
  .profile-page .principles-grid .principle-card{
    min-height: 375px;
    padding: 15px;
  }
  .principle-content .moderation-status{
    font-size: 0.8rem;
  }
  .principle-content .principle-action-btn, .principle-content .moderation-icon{
    font-size: 0.8rem;
  }
  .add-principle-title input, .add-principle-desc textarea{
    font-size: 16px;
  }
  .profile-info-block .profile-info-form.save-btn {
    font-size: 0.65rem;
  }
}

/* Hide scrollbars on mobile for wrappers */
.responsive-table-wrapper::-webkit-scrollbar {
  display: none;
}
.responsive-table-wrapper {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Hide main nav on mobile, only show mobile nav */
@media (max-width: 700px) {
  .profile-info-form.save-btn{
    font-size: 0.85rem;
  }
  form .logout-btn{
    font-size: 1.15rem;
    line-height: 15px;
  }
  #editProfileButtons{
    /* margin-right: 40px !important; */
  }
  #editProfileBtn{
    top: 8px;
    right: 50px;
    font-size: 0.70rem;
  }
  form .profile-edit-input{
    font-size: 0.75rem;
    padding: 5px;
    width: 99%;
  }
}

body.menu-open {
  overflow: hidden; /* Prevent scrolling of page when menu is open */
}
.edit-principle-form {
    display: block;
    width: 100%;
    height: 85%;
}
.edit-title-input {
    padding: 8px;
    border: 1px solid lightgrey;
    border-radius: 8px;
}
.edit-desc-input {
    border: 1px solid lightgrey;
    border-radius: 8px;
    height: 75%;
    padding: 8px;
}

/* Mobile navigation - smaller text */
@media (max-width: 768px) {
    .nav-button {
        font-size: 0.6rem !important;
        padding: 8px 12px !important;
    }
    
    .nav-left {
        gap: 0px !important;
    }
}

/* Email toggle button styling */
.toggle-email-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    margin-left: 8px;
    padding: 0px 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.obfuscated-email {
    letter-spacing: 1px;
    font-size: 0.75rem;
}

/* Pagination disabled state */
.pagination-btn[style*="pointer-events:none"] {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn {
    background: #8fd3ff;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 22px;
    font-size: 1.1rem;
    cursor: pointer;
    margin: 0 2px;
    transition: background 0.2s;
    text-decoration: none;
}
.pagination-btn:disabled {
    background: #e0e0e0;
    color: #aaa;
    cursor: not-allowed;
}