/* Admin Panel UI/UX Enhancements */

/* Loading skeleton animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Spin animation for loading indicators */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Smooth transitions for all interactive elements */
input:focus,
textarea:focus,
button:hover {
    transition: all 0.2s ease-in-out;
}

/* Disabled button states */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Validation message styles */
.validation-message {
    font-size: 10px;
    font-weight: 700;
    margin-top: 6px;
    transition: all 0.2s ease-in-out;
}

/* Link counter styles */
.link-counter {
    font-size: 10px;
    font-weight: 700;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Empty state styles */
.empty-state {
    text-align: center;
    padding: 3rem;
    border: 2px dashed rgb(30 41 59);
    border-radius: 1.5rem;
    background: rgba(15, 23, 42, 0.4);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.2;
}

/* Loading state for tables */
.table-loading {
    padding: 2rem;
    text-align: center;
}

.table-loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(99, 102, 241, 0.3);
    border-top-color: rgb(99, 102, 241);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Success/Error toast color variants */
.toast-success {
    border-color: rgba(16, 185, 129, 0.4) !important;
}

.toast-error {
    border-color: rgba(239, 68, 68, 0.4) !important;
}

/* Character counter for inputs */
.char-counter {
    font-size: 9px;
    color: rgb(100 116 139);
    margin-top: 4px;
    text-align: right;
}

/* Responsive table wrapper */
@media (max-width: 640px) {
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Focus ring improvements */
input:focus-visible,
textarea:focus-visible,
button:focus-visible {
    outline: 2px solid rgb(99, 102, 241);
    outline-offset: 2px;
}

/* Smooth scale animation for buttons */
button:active:not(:disabled) {
    transform: scale(0.98);
}

/* Helper text styles */
.helper-text {
    font-size: 9px;
    color: rgb(71 85 105);
    margin-top: 6px;
    line-height: 1.4;
}

/* Badge styles for action types */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-add {
    background: rgba(16, 185, 129, 0.2);
    color: rgb(52, 211, 153);
}

.badge-edit {
    background: rgba(59, 130, 246, 0.2);
    color: rgb(96, 165, 250);
}

.badge-delete {
    background: rgba(239, 68, 68, 0.2);
    color: rgb(248, 113, 113);
}

/* Relative time display */
.relative-time {
    font-size: 9px;
    color: rgb(71 85 105);
    white-space: nowrap;
}

/* Modal backdrop blur effect */
.modal-backdrop {
    backdrop-filter: blur(8px);
}

/* Confirmation modal animation */
.modal-content {
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Touch-friendly button sizes for mobile */
@media (max-width: 640px) {
    button {
        min-height: 44px;
        min-width: 44px;
    }

    /* Single column layout for stats */
    .grid-cols-3 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    /* Responsive spacing */
    .max-w-2xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Responsive typography */
    h1 {
        font-size: 1.5rem;
    }

    /* Stack buttons vertically */
    .flex-wrap {
        flex-direction: column;
    }

    /* Full width buttons on mobile */
    button[type="button"] {
        width: 100%;
    }

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }

    /* Responsive table */
    .table-wrapper {
        -webkit-overflow-scrolling: touch;
    }
}

/* Extra small screens (320px) */
@media (max-width: 360px) {

    /* Even smaller text for tiny screens */
    .text-3xl {
        font-size: 1.5rem;
    }

    .text-2xl {
        font-size: 1.25rem;
    }

    /* Reduce padding */
    .p-5,
    .p-6 {
        padding: 1rem;
    }

    .p-4 {
        padding: 0.75rem;
    }
}

/* Tablet and up */
@media (min-width: 641px) {

    /* Two column layout for quick actions */
    .grid-cols-2.sm\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    /* Three column layout for stats */
    .grid-cols-1.sm\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Smooth transitions for responsive changes */
* {
    transition-property: padding, margin, font-size;
    transition-duration: 0.2s;
    transition-timing-function: ease-in-out;
}

/* Prevent transition on page load */
.no-transition {
    transition: none !important;
}

/* Pagination styles */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.pagination-info {
    font-size: 12px;
    color: rgb(100 116 139);
    font-weight: 700;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-button {
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.page-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-button.active {
    background: rgb(99, 102, 241);
    color: white;
}

.page-button:not(.active):not(:disabled):hover {
    background: rgb(51, 65, 85);
    color: white;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Dashboard quick actions hover effects */
.quick-action-card {
    transition: all 0.2s ease-in-out;
}

.quick-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* Recent activity item animations */
.activity-item {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Stat card hover effect */
.stat-card {
    transition: all 0.2s ease-in-out;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgb(71, 85, 105);
}

/* Responsive pagination */
@media (max-width: 640px) {
    .pagination-controls {
        flex-direction: column;
        gap: 0.75rem;
    }

    .pagination-info {
        text-align: center;
        width: 100%;
    }

    .pagination-buttons {
        width: 100%;
        justify-content: center;
    }
}