:root {
    --saffron: #E8821A;
    --saffron-light: #F5A623;
    --saffron-dark: #C06A10;
    --maroon: #7B1F2E;
    --maroon-light: #A0293D;
    --gold: #C9A84C;
    --gold-light: #E2C97E;
    --cream: #FDF6E3;
    --cream-dark: #F5E6C8;
    --brown: #4A2C0A;
    --brown-light: #6B3D0F;
    --ink: #1C0A00;
    --text: #3D1F00;
    --muted: #8B6A4A;
    --white: #FFFDF7;
    --shadow: rgba(74, 44, 10, 0.15);
    --shadow-deep: rgba(74, 44, 10, 0.3);
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--cream);
    color: var(--text);
    min-height: 100vh;
}

/* Decorative background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse at 10% 10%, rgba(232,130,26,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 90%, rgba(123,31,46,0.06) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C9A84C' fill-opacity='0.04'%3E%3Cpath d='M30 0 L60 30 L30 60 L0 30 Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* ===== HEADER ===== */
header {
    background: linear-gradient(135deg, var(--maroon) 0%, var(--brown) 50%, var(--maroon-light) 100%);
    padding: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow-deep);
}

header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='20' viewBox='0 0 100 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 10 Q25 0 50 10 Q75 20 100 10' stroke='%23C9A84C' stroke-opacity='0.15' stroke-width='1' fill='none'/%3E%3C/svg%3E") repeat-x;
    opacity: 0.5;
}

.header-top {
    background: linear-gradient(90deg, var(--saffron-dark), var(--saffron), var(--gold), var(--saffron), var(--saffron-dark));
    height: 4px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    position: relative;
    z-index: 1;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--saffron), var(--gold));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 4px 12px rgba(232,130,26,0.4);
}

.header-title h1 {
    font-family: 'Yatra One', cursive;
    font-size: 26px;
    color: var(--gold-light);
    letter-spacing: 1px;
    line-height: 1.2;
}

.header-title span {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    color: rgba(245,230,200,0.6);
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
    display: block;
}

.stats-bar {
    display: flex;
    gap: 24px;
}

.stat-item {
    text-align: center;
    padding: 8px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(201,168,76,0.2);
    border-radius: 8px;
}

.stat-num {
    font-size: 22px;
    font-weight: 600;
    color: var(--gold-light);
    font-family: 'Yatra One', cursive;
}

.stat-label {
    font-size: 10px;
    color: rgba(245,230,200,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== NAV ===== */
nav {
    background: var(--brown);
    display: flex;
    gap: 0;
    padding: 0 40px;
    border-bottom: 2px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px var(--shadow-deep);
}

.nav-btn {
    padding: 5px 20px;
    background: none;
    border: none;
    color: rgba(245,230,200,0.6);
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn:hover { color: var(--gold-light); }

.nav-btn.active {
    color: var(--gold-light);
}

.nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--saffron), var(--gold));
}

/* ===== MAIN CONTENT ===== */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px;
    position: relative;
    z-index: 1;
}

/* .section { display: none; animation: fadeIn 0.4s ease; }
.section.active { display: block; } */

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

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title h2 {
    font-family: 'Yatra One', cursive;
    font-size: 28px;
    color: var(--maroon);
}

.page-title .subtitle {
    font-size: 13px;
    color: var(--muted);
    font-weight: 400;
}

.title-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--saffron), var(--gold));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(232,130,26,0.3);
}

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--saffron), var(--saffron-dark));
    color: white;
    box-shadow: 0 3px 10px rgba(232,130,26,0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(232,130,26,0.45); }

.btn-danger {
    background: rgba(123,31,46,0.08);
    color: var(--maroon);
    border: 1px solid rgba(123,31,46,0.15);
}
.btn-danger:hover,.tag.tag-granth:hover { background: var(--maroon); color: white; }

.btn-sm { padding: 6px 12px; font-size: 11px; }

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(28,10,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal {
    background: var(--white);
    border-radius: 16px;
    padding: 36px;
    width: 560px;
    max-width: 95vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px var(--shadow-deep);
    border: 1px solid var(--cream-dark);
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(-20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal h3 {
    font-family: 'Yatra One', cursive;
    font-size: 22px;
    color: var(--maroon);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--cream-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--brown);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 7px;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--cream-dark);
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--cream);
    transition: all 0.2s;
    outline: none;
}
.form-control:focus {
    border-color: var(--saffron);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(232,130,26,0.1);
}

textarea.form-control { min-height: 90px; resize: vertical; }

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--cream-dark);
}

.btn-cancel {
    background: none;
    border: 1.5px solid var(--cream-dark);
    color: var(--muted);
}
.btn-cancel:hover { border-color: var(--maroon); color: var(--maroon); }

/* ===== GRID & CARDS ===== */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.card {
    background: var(--white);
    border-radius: 12px;
    padding: 22px;
    border: 1px solid var(--cream-dark);
    box-shadow: 0 2px 8px var(--shadow);
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--saffron), var(--gold));
    opacity: 0;
    transition: opacity 0.3s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px var(--shadow-deep); }
.card:hover::before { opacity: 1; }

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-title {
    font-family: 'Tiro Devanagari Sanskrit', serif;
    font-size: 17px;
    color: var(--maroon);
    font-weight: 400;
    line-height: 1.4;
    flex: 1;
}

.card-actions { display: flex; gap: 6px; margin-left: 10px; }

.card-desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 14px;
}

.card-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--cream-dark);
}

.tag {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tag-topic { background: rgba(232,130,26,0.1); color: var(--saffron-dark); }
.tag-granth { background: rgba(123,31,46,0.1); color: var(--maroon); }
.tag-count { background: rgba(201,168,76,0.15); color: var(--brown-light); }

/* Praman Image Card */
.praman-card { padding: 0; }
.praman-img {
    width: 100%;
    /*height: 200px;*/
    object-fit: cover;
    border-radius: 12px 12px 0 0;
    display: block;
    background: var(--cream-dark);
}
.praman-img-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--cream-dark), var(--cream));
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--gold);
}
.praman-body { padding: 18px 20px 20px; }

/* File Upload */
.file-upload-area {
    border: 2px dashed var(--cream-dark);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--cream);
}
.file-upload-area:hover {
    border-color: var(--saffron);
    background: rgba(232,130,26,0.04);
}
.file-upload-area .upload-icon { font-size: 36px; margin-bottom: 8px; }
.file-upload-area p { font-size: 13px; color: var(--muted); }
.file-upload-area strong { color: var(--saffron-dark); }
#imagePreview { width: 100%; max-height: 200px; object-fit: contain; border-radius: 8px; margin-top: 10px; display: none; }

/* Empty state */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}
.empty-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.4; }
.empty h3 { font-family: 'Yatra One', cursive; font-size: 20px; color: var(--brown-light); margin-bottom: 8px; }
.empty p { font-size: 14px; }

/* Loading */
.loading { text-align: center; padding: 40px; color: var(--muted); }
.spinner { display: inline-block; width: 32px; height: 32px; border: 3px solid var(--cream-dark); border-top-color: var(--saffron); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--brown);
    color: var(--gold-light);
    padding: 14px 22px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px var(--shadow-deep);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 3px solid var(--saffron);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { border-left-color: var(--maroon); }

/* Dashboard */
.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 40px; }
.dash-card {
    background: var(--white);
    border-radius: 14px;
    padding: 28px;
    border: 1px solid var(--cream-dark);
    box-shadow: 0 2px 10px var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.25s;
    cursor: pointer;
}
.dash-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px var(--shadow-deep); }
.dash-icon { width: 60px; height: 60px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 28px; flex-shrink: 0; }
.dash-icon.orange { background: linear-gradient(135deg, var(--saffron), var(--saffron-dark)); box-shadow: 0 4px 14px rgba(232,130,26,0.4); }
.dash-icon.red { background: linear-gradient(135deg, var(--maroon-light), var(--maroon)); box-shadow: 0 4px 14px rgba(123,31,46,0.4); }
.dash-icon.gold { background: linear-gradient(135deg, var(--gold-light), var(--gold)); box-shadow: 0 4px 14px rgba(201,168,76,0.4); }
.dash-num { font-family: 'Yatra One', cursive; font-size: 36px; color: var(--maroon); line-height: 1; }
.dash-lbl { font-size: 13px; color: var(--muted); margin-top: 4px; font-weight: 500; }
#granthimagePreview{
    max-width: 100%;
}
#pramanImagePreview{
    width: 100%;
}
@media (max-width: 768px) {
    .header-content { flex-direction: column; gap: 16px; padding: 16px 20px; }
    nav { padding: 0 10px; overflow-x: auto; }
    main { padding: 20px; }
    .dash-grid { grid-template-columns: 1fr; }
    .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .stats-bar { gap: 10px; }

    .modal{
        padding: 5px;
        max-width: 97vw;
    }
    nav{
        flex-direction: column;
    }
    .page-header{
        flex-direction: column;
        gap: 10px;
    }

    #pramanImagePreview{
        max-width: 95vw;
    }
    #granthimagePreview{
        max-width: 80vw;
    }

    .card.granth_list{
        max-width: 100vw;
    } 
    img.granth-picture{
        max-width: 100%;
    }
}

.error{
    color:#ff0000 !important;
}
.wb{
    background-color: #fff;
}

.loading-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f0f0f0;
  border-top: 5px solid #3498db; /* blue */
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#loading{
    display: none;
}


/* Mobile menu */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  z-index: 1000;
  background-color: #fff;
  color: #ff0000;
  margin: 10px 0;
}

.hamburger span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: #333; /* change to match your nav text/icon color */
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* Animate hamburger → X when open */
.hamburger.open span:nth-child(1) {
  transform: translateY(8.5px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-8.5px) rotate(-45deg);
}
.nav-menu {
    display: flex;
    list-style-type: none;
   
}
.nav-menu a{text-decoration: none;}
/* Mobile styles */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  /* Hide the nav by default on mobile */

  
  
  /* nav ul, */
  .nav-menu {
    display: none;
    list-style-type: none;
    flex-direction: column;
    /*position: absolute;*/
    top: 60px; /* adjust to your header height */
    left: 0;
    width: 100%;
    /*background-color: #fff; */
    /* match your nav background */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 16px 0;
    z-index: 999;

    padding: 0;
    margin: 0;
    gap: 20px;

  }

  /* Show nav when open class is added */
  nav ul.open,
  .nav-menu.open {
    display: flex;
  }

  nav ul li,
  .nav-menu li {
    border-bottom: 1px solid #f0f0f0;
  }

  nav ul li:last-child,
  .nav-menu li:last-child {
    border-bottom: none;
  }
}

.center{
    text-align: center;
}
#praman_exp{
    border: 2px solid #7B1F2E;
    padding: 5px;
    border-radius: 15px;
    width: 100%;
    display: none;
}
/* end of mobile menu */

#takeToTop {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 30px;
  z-index: 99;
  font-size: 18px;
  border: none;
  outline: none;
  background-color: red;
  color: white;
  cursor: pointer;
  padding: 15px;
  border-radius: 4px;
}

#takeToTop:hover {
  background-color: #555;
}


.goTo{
    width: 65px;
    padding: 5px 10px;
}



/* Scrollbar */
::-webkit-scrollbar {
    -webkit-appearance: none;
}
::-webkit-scrollbar:vertical {
    width: 12px;
}
::-webkit-scrollbar:horizontal {
    height: 12px;
}
::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, .5);
    border-radius: 10px;
    border: 2px solid #ffffff;
}
::-webkit-scrollbar-track {
    border-radius: 10px;
    background-color: #ffffff;
}

.tag.tag-granth{
    cursor: pointer;
}


/* Style applied only when the select box is disabled */
select:disabled {
  background-color: #f5f5f5;
  color: #a1a1a1;
  cursor: not-allowed; /* Shows a "no entry" cursor */
  opacity: 0.7;
}

/* Style applied when the select box is active/enabled */
select:enabled {
  background-color: #ffffff;
  color: #333333;
  cursor: pointer;
}

.green-dot {
    width: 12px;
    height: 12px;
    background-color: #2ecc71;
    border-radius: 50%;
    display: inline-block;
}
.red-dot {
    width: 12px;
    height: 12px;
    background-color: #ff0000;
    border-radius: 50%;
    display: inline-block;
}
