/* Kapadokya Studio - Custom Styles */

/* Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Form Input Class */
.ks-input {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 0.875rem;
    line-height: 1.25rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: 'Inter', sans-serif;
}

.ks-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.ks-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.ks-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Select styling */
select.ks-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999080' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* Textarea styling */
textarea.ks-input {
    min-height: 80px;
    resize: vertical;
}

/* Notification bell shake */
@keyframes bellShake {

    0%,
    100% {
        transform: rotate(0);
    }

    15% {
        transform: rotate(10deg);
    }

    30% {
        transform: rotate(-8deg);
    }

    45% {
        transform: rotate(6deg);
    }

    60% {
        transform: rotate(-4deg);
    }

    75% {
        transform: rotate(2deg);
    }
}

.notification-bell-shake svg {
    animation: bellShake 0.6s ease-in-out;
    animation-iteration-count: 1;
}

/* Toast animation */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast-item {
    animation: toastSlideIn 0.3s ease-out forwards;
}

.toast-item.removing {
    animation: toastSlideOut 0.3s ease-in forwards;
}

/* Progress bar */
.ks-progress {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.ks-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Table row hover */
tr.customer-row:hover {
    background: var(--bg-secondary) !important;
}

/* Badge */
.ks-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25rem;
}

/* Button styles */
.ks-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'Inter', sans-serif;
}

.ks-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ks-btn-primary {
    background: var(--primary);
    color: white;
}

.ks-btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.ks-btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.ks-btn-outline:hover:not(:disabled) {
    background: var(--bg-secondary);
}

/* Card */
.ks-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* Sidebar transition */
aside {
    transition: width 0.2s ease, transform 0.2s ease;
}

/* Print */
@media print {

    aside,
    header,
    #toast-container {
        display: none !important;
    }

    main {
        margin: 0 !important;
        padding: 1rem !important;
    }
}

/* ============================================
   ANIMATIONS & TRANSITIONS
   ============================================ */

/* Page content fade-in */
@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main>* {
    animation: pageFadeIn 0.2s ease-out both;
}

/* Stagger children for lists and grids */
.stagger-in>* {
    animation: pageFadeIn 0.35s ease-out both;
}

.stagger-in>*:nth-child(1) {
    animation-delay: 0.04s;
}

.stagger-in>*:nth-child(2) {
    animation-delay: 0.08s;
}

.stagger-in>*:nth-child(3) {
    animation-delay: 0.12s;
}

.stagger-in>*:nth-child(4) {
    animation-delay: 0.16s;
}

.stagger-in>*:nth-child(5) {
    animation-delay: 0.20s;
}

.stagger-in>*:nth-child(6) {
    animation-delay: 0.24s;
}

.stagger-in>*:nth-child(7) {
    animation-delay: 0.28s;
}

.stagger-in>*:nth-child(8) {
    animation-delay: 0.32s;
}

/* Card hover: lift + shadow */
.ks-card,
[class*="rounded-xl"][class*="border"] {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.hover-lift:hover,
.ks-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Sidebar nav item hover via CSS (replaces inline JS) */
.sidebar-nav-item:not(.active):hover {
    background: var(--bg-secondary) !important;
}

/* Dashboard stat count-up animation */
@keyframes countPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.count-up-done {
    animation: countPulse 0.3s ease-out;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Focus-visible for accessibility */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Dropdown appear */
@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-4px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Empty state illustrations */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    text-align: center;
}

.empty-state svg {
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Action button hover (replaces inline JS handlers) */
.action-btn:hover {
    background: var(--bg-secondary);
}

.action-btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Button hover: subtle scale */
.bg-primary:not(:disabled):hover,
.ks-btn-primary:not(:disabled):hover {
    transform: scale(1.02);
    transition: transform 0.15s ease, background 0.2s ease;
}

/* Table row hover tint */
table tbody tr:hover {
    background: var(--bg-secondary);
    transition: background 0.15s ease;
}