/**
 * Design Polish & Refinements
 * Subtle improvements for a more professional feel
 */

/* ============================================
   SMOOTH TRANSITIONS EVERYWHERE
   ============================================ */

* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   BUTTON IMPROVEMENTS
   ============================================ */

.btn-add-postit {
    position: relative;
    overflow: hidden;
}

.btn-add-postit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-add-postit:active::before {
    width: 300px;
    height: 300px;
}

/* Improved hover states for icon buttons */
.btn-icon {
    position: relative;
}

.btn-icon::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: -1;
}

.btn-icon:hover::after {
    opacity: 0.1;
}

/* ============================================
   POST-IT CARD POLISH
   ============================================ */

.postit-card {
    transition: transform 0.2s, box-shadow 0.2s, z-index 0s 0s !important;
}

.postit-card:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
    z-index: 10 !important;
}

.postit-card:active {
    transform: translateY(0) scale(0.99);
}

/* Smooth color transitions */
.postit-card,
.postit-header,
.postit-footer {
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

/* ============================================
   FORM INPUT REFINEMENTS
   ============================================ */

input[type="text"],
input[type="email"],
input[type="number"],
input[type="time"],
input[type="date"],
textarea,
select {
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="number"]:hover,
input[type="time"]:hover,
input[type="date"]:hover,
textarea:hover,
select:hover {
    border-color: var(--primary-400);
}

/* Better focus ring */
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* ============================================
   CURSOR POLISH
   ============================================ */

.cursor-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cursor-item:hover {
    transform: scale(1.02);
}

/* ============================================
   PHASE NAVIGATION REFINEMENT
   ============================================ */

.phase-nav-item {
    position: relative;
    transition: all 0.25s ease;
}

.phase-nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 4px;
    height: 0;
    background: var(--primary-500);
    transform: translateY(-50%);
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 2px 2px 0;
}

.phase-nav-item.active::before,
.phase-nav-item:hover::before {
    height: 80%;
}

/* ============================================
   MODAL ANIMATIONS
   ============================================ */

.modal.active {
    animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal.active .modal-content {
    animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ============================================
   CANVAS COLUMN HOVER STATE
   ============================================ */

.canvas-column {
    transition: transform 0.2s, box-shadow 0.2s;
}

.canvas-column:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

/* ============================================
   SMOOTH SCROLL BEHAVIOR
   ============================================ */

html {
    scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
    background: var(--neutral-100);
}

::-webkit-scrollbar-thumb {
    background: var(--neutral-300);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-400);
}

/* ============================================
   RISK MATRIX POLISH
   ============================================ */

.risk-item {
    transition: transform 0.2s, box-shadow 0.2s, z-index 0s;
}

.risk-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    z-index: 100;
}

/* ============================================
   ACTIVITY CARD REFINEMENT
   ============================================ */

.activity-card {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.activity-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.12) !important;
}

.activity-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

/* ============================================
   BADGE & PILL IMPROVEMENTS
   ============================================ */

.activity-type-badge,
.project-code-badge,
.session-number {
    transition: all 0.2s;
}

.activity-type-badge:hover {
    transform: scale(1.05);
}

/* ============================================
   LOADING STATES
   ============================================ */

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading-skeleton {
    background: linear-gradient(
        90deg,
        var(--neutral-100) 0%,
        var(--neutral-200) 50%,
        var(--neutral-100) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ============================================
   MICRO-INTERACTIONS
   ============================================ */

/* Save indicator pulse */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.save-indicator[data-status="saving"] {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Success checkmark animation */
@keyframes checkmark {
    0% {
        transform: scale(0) rotate(45deg);
    }
    50% {
        transform: scale(1.2) rotate(45deg);
    }
    100% {
        transform: scale(1) rotate(45deg);
    }
}

.save-indicator[data-status="saved"] .save-icon {
    animation: checkmark 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode improvements */
@media (prefers-contrast: high) {
    .btn {
        border-width: 2px;
    }

    .postit-card {
        border-width: 2px;
    }

    .canvas-column {
        border-width: 2px;
    }
}

/* ============================================
   SELECTION STYLING
   ============================================ */

::selection {
    background: var(--primary-200);
    color: var(--primary-900);
}

::-moz-selection {
    background: var(--primary-200);
    color: var(--primary-900);
}

/* ============================================
   FOCUS WITHIN IMPROVEMENTS
   ============================================ */

.canvas-column:focus-within {
    box-shadow: 0 0 0 2px var(--primary-200);
}

.form-group:focus-within label {
    color: var(--primary-600);
}
