/* Import common styles */
@import url('common.css');

body {
    background: var(--gradient-light);
    min-height: 100vh;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: var(--font-size-14px);
    font-weight: bold;
}
.avatar-lg {
    width: 80px;
    height: 80px;
    font-size: var(--font-size-32px);
    font-weight: bold;
}


/* Dropdown menu styles */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background-color: white;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 10px -3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 10px 16px;
    color: #374151;
    text-decoration: none;
    transition: background-color 0.2s ease;
    border-radius: 4px;
    margin: 2px 8px;
}

.dropdown-item:hover {
    background-color: #e5f3ff;
    color: #0066cc;
    transform: translateX(2px);
}

.dropdown-item:first-child {
    margin-top: 8px;
}

.dropdown-item:last-child {
    margin-bottom: 8px;
}

/* Sidebar slider styles */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--overlay-background);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: #ffffff;
    z-index: 1001;
    transition: left 0.3s ease;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .sidebar {
        width: 240px;
        left: -240px;
    }
}

.sidebar.show {
    left: 0;
}

.sidebar-menu-item button {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    width: 100%;
    text-align: right;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.agency-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.agency-info {
    color: #1f2937; /* text-gray-800 */
}

.sidebar .agency-initial {
    background-color: #1e3a8a; /* dark blue for initial when no image */
}

.agency-name {
    font-size: var(--font-size-18px);
    font-weight: bold;
    margin-bottom: 5px;
}

.agency-owner {
    font-size: var(--font-size-14px);
    opacity: 0.9;
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #1e3a8a; /* dark blue text */
    text-decoration: none;
    transition: all 0.3s ease;
    border-right: 3px solid transparent;
}

.sidebar-menu-item:hover {
    background: #e5f3ff; /* light blue hover */
    border-right-color: #ffd700; /* gold accent */
    transform: translateX(5px);
}

.sidebar-menu-item i {
    margin-left: 15px;
    font-size: var(--font-size-18px);
    width: 20px;
}

.sidebar-menu-item.logout {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 20px;
}

.sidebar-menu-item.logout:hover {
    background: #fee2e2;
    border-right-color: #ff4444;
}

/* Right Sidebar styles */
.right-sidebar-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--overlay-background);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.right-sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

.right-sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100vh;
    background: var(--gradient-blue);
    z-index: 1001;
    transition: right 0.3s ease;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .right-sidebar {
        width: 300px;
        right: -300px;
    }
}

.right-sidebar.show {
    right: 0;
}

.right-sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.app-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-info {
    color: white;
}

.app-name {
    font-size: var(--font-size-18px);
    font-weight: bold;
    margin-bottom: 5px;
}

.app-version {
    font-size: var(--font-size-14px);
    opacity: 0.9;
}

.right-sidebar-menu {
    padding: 20px 0;
}

.right-sidebar-menu-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.right-sidebar-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #ffd700;
    transform: translateX(-5px);
}

.right-sidebar-menu-item i {
    margin-left: 15px;
    font-size: var(--font-size-18px);
    width: 20px;
}

.sidebar-separator {
    height: 1px;
    background: linear-gradient(to left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 20%, rgba(255, 255, 255, 0.3) 80%, rgba(255, 255, 255, 0) 100%);
    margin: 15px 20px;
    position: relative;
}

.sidebar-separator::after {
    content: 'مدیریت نرم‌افزار';
    position: absolute;
    top: -10px;
    right: 50%;
    transform: translateX(50%);
    background: var(--gradient-blue);
    padding: 0 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--font-size-11px);
    white-space: nowrap;
}

/* Quick Actions Menu Animation */
#quick-actions-menu {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

#quick-actions-menu.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Individual menu item animation */
#quick-actions-menu a {
    transform: translateX(-10px);
    opacity: 0;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

#quick-actions-menu.show a {
    transform: translateX(0);
    opacity: 1;
}

/* Staggered animation for menu items */
#quick-actions-menu.show a:nth-child(1) { transition-delay: 0.05s; }
#quick-actions-menu.show a:nth-child(2) { transition-delay: 0.1s; }
#quick-actions-menu.show a:nth-child(3) { transition-delay: 0.15s; }
#quick-actions-menu.show a:nth-child(4) { transition-delay: 0.2s; }
#quick-actions-menu.show a:nth-child(5) { transition-delay: 0.25s; }

/* Fixed Right Sidebar Styles — expanded by default */
.fixed-right-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 160px;
    height: 100vh;
    background: var(--gradient-blue-semi);
    backdrop-filter: blur(10px);
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 60px 0 20px 0;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    transition: width 0.15s ease;
}

/* Fixed sidebar brand (non-interactive) */
.fixed-sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 0;
    margin: 0 0 8px 0;
}

.fixed-sidebar-brand .brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
}

.fixed-sidebar-brand .brand-name {
    color: #ffffff;
    font-size: var(--font-size-12px);
    margin-top: 6px;
    white-space: nowrap;
    max-width: 100%;
    padding: 0 8px;
    overflow: hidden;
    transition: max-width 0.15s ease, padding 0.15s ease;
}

.fixed-sidebar-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 40px;
    margin: 0;
    padding: 0 10px;
    color: white;
    text-decoration: none;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    transition: background-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.fixed-sidebar-item:hover {
    background: rgba(0, 0, 0, 0.25);
    border-right: 2px solid #ffd700;
}

.fixed-sidebar-item i {
    font-size: var(--font-size-18px);
    margin-left: 10px;
    flex-shrink: 0;
}

.fixed-sidebar-item.active {
    background: rgba(0, 0, 0, 0.25);
    border: none;
    border-right: 2px solid #ffd700;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.fixed-sidebar-item .tooltip {
    position: static;
    right: auto;
    top: auto;
    transform: none;
    background: transparent;
    color: #ffffff;
    padding: 0 8px;
    border-radius: 0;
    font-size: var(--font-size-14px);
    white-space: nowrap;
    opacity: 1;
    visibility: visible;
    transition: max-width 0.15s ease, padding 0.15s ease;
    pointer-events: auto;
    z-index: auto;
    max-width: 100%;
    overflow: hidden;
}

.fixed-sidebar-item .tooltip::after {
    display: none;
}

/* Collapse toggle button */
.fixed-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: auto 10px 0;
    padding: 0;
    color: white;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s ease, width 0.15s ease, margin 0.15s ease;
}

.fixed-sidebar-toggle:hover {
    background: rgba(0, 0, 0, 0.35);
}

.fixed-sidebar-toggle i {
    font-size: var(--font-size-14px);
}

.fixed-sidebar-toggle .toggle-label {
    display: none;
    margin-right: 6px;
    font-size: var(--font-size-12px);
    white-space: nowrap;
}

/* Collapsed state — icons only */
.fixed-right-sidebar.collapsed {
    width: 60px;
    align-items: center;
}

.fixed-right-sidebar.collapsed .fixed-sidebar-brand .brand-name {
    max-width: 0;
    padding: 0;
}

.fixed-right-sidebar.collapsed .fixed-sidebar-item {
    justify-content: center;
    width: 40px;
    padding: 0;
}

.fixed-right-sidebar.collapsed .fixed-sidebar-item i {
    margin-left: 0;
}

.fixed-right-sidebar.collapsed .fixed-sidebar-item .tooltip {
    max-width: 0;
    padding: 0;
    pointer-events: none;
}

.fixed-right-sidebar.collapsed .fixed-sidebar-toggle {
    width: 40px;
    margin: auto 0 0;
}

/* Adjust main content to account for fixed sidebar */
main {
    margin-right: 160px;
    background: transparent;
    transition: margin-right 0.15s ease;
}

.fixed-right-sidebar.collapsed ~ main {
    margin-right: 60px;
}

/* Content cards styling */
.bg-white {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Dashboard cards enhancement */
.bg-gradient-to-br {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Breadcrumb Styles */
.breadcrumb {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: var(--font-size-14px);
    color: #6b7280;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin: 0 8px;
    color: #9ca3af;
    font-weight: 300;
}

.breadcrumb-item a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #374151;
    font-weight: 500;
}

.breadcrumb-item i {
    margin-left: 6px;
    font-size: var(--font-size-12px);
}

@media (max-width: 768px) {
    .fixed-right-sidebar {
        display: none;
    }
    main {
        margin-right: 0;
    }
}

/* Ripple effect animation */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

