@tailwind base;
@tailwind components;
@tailwind utilities;

@import url("assets/fonts/iranyekanx/fontiran.css");

@font-face {
    font-family: IRANSansX;
    font-style: normal;
    font-weight: 700;
    src: url("./assets/fonts/iransans/IRANSansX-Bold.woff2") format("woff"), url("./assets/fonts/iransans/IRANSansX-Bold.woff2") format("woff2")
}

@font-face {
    font-family: IRANSansX;
    font-style: normal;
    font-weight: 400;
    src: url("./assets/fonts/iransans/IRANSansX-Regular.woff2") format("woff"), url("./assets/fonts/iransans/IRANSansX-Regular.woff2") format("woff2")
}


body {
    font-family: "IRANSansX", "IRANYekanX";
}

.font-iransans {
    font-family: "IRANSansX" !important;
}

.font-iranyekan {
    font-family: "IRANYekanX" !important;
}

.font-orbitron {
    font-family: "Orbitron", sans-serif !important;
    font-optical-sizing: auto;
    font-weight: 800;
    font-style: normal;
}

.toast-enter {
    transform: translateY(100%);
    opacity: 0;
}

.toast-show {
    transform: translateY(0);
    opacity: 1;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.toast-hide {
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.loader {
    width: 32px;
    padding: 6px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #25b09b;
    --_m:
        conic-gradient(#0000 10%, #000),
        linear-gradient(#000 0 0) content-box;
    -webkit-mask: var(--_m);
    mask: var(--_m);
    -webkit-mask-composite: source-out;
    mask-composite: subtract;
    animation: l3 1s infinite linear;
}

@keyframes l3 {
    to {
        transform: rotate(1turn)
    }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.shimmer-effect {
  position: relative;
  overflow: hidden;
}

.shimmer-effect::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  animation: shimmer 2s infinite;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
        
* {
    font-family: 'Inter', sans-serif;
}

.glass-effect {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.academic-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
    box-shadow: 
        0 4px 25px -4px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.academic-card:hover {
    box-shadow: 
        0 20px 40px -4px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.8) inset;
    transform: translateY(-2px);
}

.search-input-container {
    position: relative;
    overflow: hidden;
}

.search-input-container::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: exclude;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-input-container:focus-within::before {
    opacity: 1;
}

.search-input {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.search-input:focus {
    background: #ffffff;
    box-shadow: 
        0 0 0 3px rgba(102, 126, 234, 0.1),
        0 10px 30px -4px rgba(0, 0, 0, 0.1);
}

.search-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.search-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #5a6fd8 0%, #6b4190 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-button:hover::before {
    opacity: 0;
}

.search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -4px rgba(102, 126, 234, 0.4);
}

.search-button > * {
    position: relative;
    z-index: 1;
}

.language-tab {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.language-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px -4px rgba(102, 126, 234, 0.4);
}

.language-tab:not(.active):hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.advanced-toggle {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.advanced-toggle:hover {
    background: rgba(102, 126, 234, 0.05);
    color: #667eea;
}

.advanced-panel {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
    box-shadow: 
        0 8px 30px -4px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-input {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-input:focus {
    background: #ffffff;
    border-color: #667eea;
    box-shadow: 
        0 0 0 3px rgba(102, 126, 234, 0.1),
        0 4px 15px -4px rgba(0, 0, 0, 0.1);
}

.custom-selectbox {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.custom-selectbox:hover {
    border-color: #667eea;
    background: #ffffff;
}

.custom-checkbox {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.8);
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-checkbox:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.custom-checkbox:checked::before {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.result-counter {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.sparkle-icon {
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* Responsive improvements */
@media (max-width: 768px) {
    .search-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .language-tab {
        padding: 8px 12px;
        font-size: 13px;
    }
}
/* Add these styles to your CSS file */

/* Shimmer loading effect for search results */
@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.shimmer-effect {
  animation: shimmer 2s ease-in-out infinite;
  background: linear-gradient(90deg, #f0f0f0 0px, rgba(229, 229, 229, 0.8) 40px, #f0f0f0 80px);
  background-size: 200px;
}

/* Enhanced pagination input styles */
#page-input::-webkit-outer-spin-button,
#page-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#page-input[type=number] {
  -moz-appearance: textfield;
}

#page-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Enhanced button hover effects */
.search-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.search-button:active {
  transform: translateY(0);
}

/* Responsive pagination */
@media (max-width: 640px) {
  #pagination-container {
    flex-direction: column;
    gap: 12px;
  }
  
  #pagination-container .flex {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Enhanced search state indicators */
.search-restored {
  border: 2px solid #10b981;
  background: linear-gradient(45deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
}

.search-restored::before {
  content: "Restored";
  position: absolute;
  top: -8px;
  right: 12px;
  background: #10b981;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

/* Loading state for buttons */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

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

/* Search preservation indicator */
.search-preserved::after {
  content: "✓ Search saved";
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #10b981;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}


 /* spinner */
  .btn-loading { position: relative; pointer-events: none; opacity: .7; }
.btn-loading .spinner {
  display: inline-block;
  width: 2em;
  height: 2em;
  margin-left: .5rem;
  vertical-align: middle;
}

.btn-loading .spinner svg {
  width: 100%;
  height: 100%;
  animation: spin 0.8s linear infinite;
}

.btn-loading .spinner circle {
  stroke-dasharray: 125;
  stroke-dashoffset: 100;
}

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

  /* modal */
  .summ-modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 99999;
  }
  .summ-modal {
    width: min(1000px, 95vw); background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.25);
    max-height: 85vh; display: flex; flex-direction: column;
  }
  .summ-modal header { padding: 14px 18px; border-bottom: 1px solid #eee; font-weight: 600; }
  .summ-modal .content { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
  .summ-modal .pane {
    padding: 14px; overflow: auto; max-height: 60vh; border-right: 1px solid #f0f0f0;
  }
  .summ-modal .pane:last-child { border-right: none; }
  .summ-modal .pane h4 { margin: 0 0 8px; font-size: 14px; color: #444; }
  .summ-modal .pane pre {
    white-space: pre-wrap; word-break: break-word; background: #fafafa; border: 1px solid #eee; padding: 10px; border-radius: 6px; margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.45;
  }
  .summ-modal footer {
    display: flex; gap: 8px; justify-content: flex-end; padding: 12px; border-top: 1px solid #eee;
  }
  .summ-modal button {
    height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid #ddd; background: #fff; cursor: pointer;
  }
  .summ-modal .btn-primary { background: #111827; color: #fff; border-color: #111827; }

  .summ-modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(17,24,39,0.55);
    display: flex; align-items: center; justify-content: center;
    z-index: 99999;
    backdrop-filter: blur(2px);
  }

  .summ-modal {
    width: min(900px, 95vw);
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
    display: flex; flex-direction: column;
    animation: fadeInScale .25s ease;
  }

  @keyframes fadeInScale {
    from { opacity: 0; transform: scale(.95); }
    to { opacity: 1; transform: scale(1); }
  }

  .summ-modal header {
    padding: 16px 22px;
    background: #111827;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    display: flex; align-items: center; justify-content: space-between;
  }

  .summ-modal .content {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 0; min-height: 280px;
  }

  .summ-modal .pane {
    padding: 20px;
    overflow-y: auto;
    background: #fafafa;
    display: flex; flex-direction: column;
  }

  .summ-modal .pane:nth-child(2) {
    background: #fdfdfd;
    border-left: 1px solid #e5e7eb;
  }

  .summ-modal .pane h4 {
    margin: 0 0 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
    color: #6b7280;
  }

  .summ-modal .pane .text-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
    flex: 1;
  }

  .summ-modal footer {
    padding: 14px 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex; justify-content: flex-end; gap: 10px;
  }

  .summ-modal button {
    border-radius: 8px;
    height: 38px; padding: 0 18px;
    font-size: 14px; font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer; transition: background .2s, color .2s;
  }

  .summ-modal .btn-cancel {
    background: #fff; border: 1px solid #d1d5db; color: #374151;
  }
  .summ-modal .btn-cancel:hover { background: #f3f4f6; }

  .summ-modal .btn-primary {
    background: #111827; color: #fff;
  }
  .summ-modal .btn-primary:hover { background: #1f2937; }




:root { --footer-h: 4rem; } /* matches h-16 */
body { padding-bottom: var(--footer-h); }
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  body { padding-bottom: calc(var(--footer-h) + env(safe-area-inset-bottom)); }
}