body {
    font-family: 'Vazirmatn', 'Inter', system-ui, -apple-system, sans-serif;
    font-feature-settings: 'cv01', 'cv02', 'cv03', 'cv04';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
}

#app-container {
    direction: rtl;
}

/* Modern floating navigation */
.floating-nav {
    z-index: 50;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(203, 213, 225, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

/* Enhanced scrollbar styling */
#previews-list::-webkit-scrollbar {
    width: 4px;
}
#previews-list::-webkit-scrollbar-track {
    background: transparent;
}
#previews-list::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #06b6d4, #0891b2);
    border-radius: 10px;
}
#previews-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #0891b2, #0e7490);
}

#frontend-display {
    min-height: 300px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

/* Enhanced tooltip styling */
.tooltip-arrow,
.tooltip-arrow::before {
  position: absolute;
  width: 8px;
  height: 8px;
  background: inherit;
}
.tooltip-arrow {
  visibility: hidden;
}
.tooltip-arrow::before {
  visibility: visible;
  content: '';
  transform: rotate(45deg);
}
#tooltip[data-popper-placement^='top'] > .tooltip-arrow {
  bottom: -4px;
}
#tooltip[data-popper-placement^='bottom'] > .tooltip-arrow {
  top: -4px;
}
#tooltip[data-popper-placement^='left'] > .tooltip-arrow {
  right: -4px;
}
#tooltip[data-popper-placement^='right'] > .tooltip-arrow {
  left: -4px;
}

/* Modern tab styles with floating effect */
.tab-btn {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px;
    border: 2px solid transparent;
    letter-spacing: normal;
    background: transparent;
    backdrop-filter: blur(10px);
    font-weight: 500;
}
.tab-btn.active {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    color: #0f172a;
    font-weight: 600;
    border-color: #e2e8f0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}
.tab-btn:hover:not(.active) {
    color: #0891b2;
    background: rgba(6, 182, 212, 0.05);
    border-color: rgba(6, 182, 212, 0.2);
    transform: translateY(-1px);
}

.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
    animation: fadeInContent 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modern card styles replacing tables */
.inventory-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.inventory-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #06b6d4, #0891b2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.inventory-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: #06b6d4;
}

.inventory-card:hover::before {
    opacity: 1;
}

.status-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-available {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.status-borrowed {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border: 1px solid #fbbf24;
}

.status-idle {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    border: 1px solid #60a5fa;
}

/* Enhanced post cards for home feed */
.post-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #06b6d4, #0891b2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
    border-color: #06b6d4;
}

.post-card:hover::before {
    opacity: 1;
}

/* Modern button styles - outline focused */
.btn-outline {
    border: 2px solid #06b6d4;
    background: transparent;
    color: #0891b2;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    background: #06b6d4;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.3);
}

.btn-outline.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-outline.btn-disabled {
    border-color: #94a3b8;
    color: #94a3b8;
    cursor: not-allowed;
}

.btn-outline.btn-disabled:hover {
    background: transparent;
    transform: none;
    box-shadow: none;
}

.btn-outline.btn-danger {
    border-color: #fca5a5;
    color: #b91c1c;
}
.btn-outline.btn-danger:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

/* Primary button for main actions */
.btn-primary {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    border: none;
    color: #ffffff;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0891b2, #0e7490);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.4);
}

.btn-primary.btn-large {
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 12px;
}

.btn-primary.btn-disabled,
.btn-primary.btn-disabled:hover {
    background: #94a3b8;
    color: #e2e8f0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Announce Button */
.btn-announce {
    background: linear-gradient(135deg, #fb923c, #f97316);
    border: none;
    color: #ffffff;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}
.btn-announce:hover {
    background: linear-gradient(135deg, #f97316, #ea580c);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4);
}

/* Enhanced animations */
.fade-in {
    animation: fadeIn 1s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Enhanced form elements */
input, textarea, select {
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

input:focus, textarea:focus, select:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.1);
    border-color: #06b6d4;
    outline: none;
}

/* Mobile responsive improvements */
@media (max-width: 768px) {
    #frontend-display {
        border-radius: 16px;
        margin: 4px;
        height: calc(100% - 8px);
    }
    
    main {
        padding: 8px;
    }

    .post-card:hover {
        transform: translateY(-2px);
    }
    
    .tab-btn {
        padding: 10px 16px;
        font-size: 14px;
        border-radius: 12px;
    }
    
    .inventory-card {
        padding: 16px;
        border-radius: 12px;
    }
    
    .floating-nav {
        top: 0;
        margin: 0;
        width: 100%;
        justify-content: center;
        border-radius: 16px;
    }

    /* Mobile panel improvements */
    #side-panel {
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        backdrop-filter: blur(20px);
        border-radius: 0 20px 20px 0;
    }
}

/* Enhanced gradient backgrounds */
.bg-gradient-to-br {
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Typography enhancements */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
    color: #0f172a;
}

p {
    line-height: 1.7;
    color: #475569;
}

/* Enhanced status badges */
.status-badge {
    font-weight: 600;
    font-size: 11px;
    padding: 6px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid;
}

/* Icon enhancements */
.icon-outline {
    stroke-width: 2;
    transition: all 0.3s ease;
}

.icon-outline:hover {
    transform: scale(1.1);
}

/* Section containers */
.section-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Comment input styling */
.comment-input {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    transition: all 0.3s ease;
    font-size: 14px;
}

.comment-input:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.1);
    outline: none;
}

/* Floating action elements */
.floating-element {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.5);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Next Step Cards */
.next-step-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}
.next-step-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: #93c5fd;
}
.next-step-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 20px;
    white-space: nowrap;
    align-self: flex-start;
}
.tag-blue {
    background-color: #dbeafe;
    color: #1e40af;
}
.tag-green {
    background-color: #d1fae5;
    color: #065f46;
}
.tag-purple {
    background-color: #ede9fe;
    color: #5b21b6;
}

/* Log Accordion Styles */
.log-entry {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background-color: #f8fafc;
    overflow: hidden;
}

.log-entry-header {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}
.log-entry-header:hover {
    background-color: #f1f5f9;
}

.log-entry-header .log-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.log-entry-header.open .log-icon {
    transform: rotate(90deg);
}

.log-entry-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: white;
}

.log-entry-body.open {
    max-height: 800px; /* A large enough value to show content */
}

.log-content {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
}

.log-content pre {
    background-color: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    font-family: 'Vazirmatn', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}