// ============================================
// ADMIN BOOKING - Component-Specific Styles
// ============================================
@import '../admin-shared.scss';

// ============================================
// HEADER EXTENSIONS
// ============================================
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: $admin-space-sm;

    @media (max-width: 640px) {
        flex-direction: column;
        align-items: stretch;
    }
}

.header-content {
    min-width: 0;
}

// ============================================
// CALENDAR NAVIGATION
// ============================================
.calendar-nav {
    display: flex;
    align-items: center;
    gap: $admin-space-xs;
    padding: $admin-space-sm;
    background: $glass-bg;
    border: 1px solid $glass-border;
    border-radius: $radius-md;
    margin-bottom: $admin-space-md;
    animation: fadeIn 0.3s ease-out 0.1s backwards;

    @media (max-width: 480px) {
        flex-wrap: wrap;
        justify-content: center;
    }
}

.nav-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: $admin-space-sm;

    h2 {
        font-size: 0.9375rem;
        font-weight: 700;
        color: $color-text-primary;
        margin: 0;

        @media (min-width: 768px) {
            font-size: 1rem;
        }
    }
}

// ============================================
// CALENDAR GRID
// ============================================
.calendar-container {
    background: $glass-bg;
    border: 1px solid $glass-border;
    border-radius: $radius-md;
    overflow: hidden;
    animation: fadeIn 0.3s ease-out 0.15s backwards;

    @media (max-width: 768px) {
        display: none;
    }
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: rgba($color-gray-50, 0.8);
    border-bottom: 1px solid $border-default;
}

.weekday {
    padding: $admin-space-xs;
    text-align: center;
    font-size: 0.6875rem;
    font-weight: 700;
    color: $color-text-tertiary;
    text-transform: uppercase;
    letter-spacing: 0.03em;

    @media (max-width: 480px) {
        padding: 6px 2px;
        font-size: 0.5625rem;
    }
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
    min-height: 90px;
    padding: $admin-space-xs;
    border-right: 1px solid $border-default;
    border-bottom: 1px solid $border-default;
    background: white;
    transition: all $transition-fast;
    position: relative;

    &:nth-child(7n) {
        border-right: none;
    }

    &:hover {
        background: rgba($color-brand-primary, 0.02);
    }

    &.other-month {
        background: $color-gray-50;
        opacity: 0.5;
    }

    &.today {
        background: rgba($color-brand-primary, 0.05);
        
        .day-number {
            background: $color-brand-primary;
            color: white;
        }
    }

    &.has-slots {
        .btn-add-slot {
            display: none;
        }
    }

    @media (max-width: 640px) {
        min-height: 60px;
        padding: 4px;
    }
}

.day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.day-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: $color-text-primary;
    border-radius: 50%;
    transition: all $transition-fast;

    @media (max-width: 480px) {
        width: 20px;
        height: 20px;
        font-size: 0.625rem;
    }
}

.slot-count {
    font-size: 0.625rem;
    font-weight: 700;
    color: $color-brand-primary;
    background: rgba($color-brand-primary, 0.1);
    padding: 2px 6px;
    border-radius: $radius-full;
}

.day-slots {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.slot-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 6px;
    border-radius: $radius-sm;
    font-size: 0.625rem;
    cursor: pointer;
    transition: all $transition-fast;

    &.available {
        background: rgba($accent-green, 0.12);
        color: darken($accent-green, 10%);

        &:hover {
            background: rgba($accent-green, 0.2);
        }
    }

    &.booked {
        background: rgba($accent-orange, 0.12);
        color: darken($accent-orange, 10%);

        &:hover {
            background: rgba($accent-orange, 0.2);
        }
    }

    &.unavailable {
        background: rgba($color-gray-400, 0.12);
        color: $color-gray-500;

        &:hover {
            background: rgba($color-gray-400, 0.2);
        }
    }
}

.slot-time {
    font-weight: 600;
}

.slot-status-icon {
    font-size: 0.75rem;
    opacity: 0.8;
}

.more-slots {
    padding: 2px 6px;
    font-size: 0.5625rem;
    font-weight: 600;
    color: $color-brand-primary;
    background: rgba($color-brand-primary, 0.08);
    border: none;
    border-radius: $radius-sm;
    cursor: pointer;
    transition: all $transition-fast;

    &:hover {
        background: rgba($color-brand-primary, 0.15);
    }
}

.btn-add-slot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px dashed $border-default;
    border-radius: $radius-sm;
    color: $color-text-tertiary;
    cursor: pointer;
    opacity: 0;
    transition: all $transition-fast;

    app-icon {
        font-size: 0.875rem;
    }

    .calendar-day:hover & {
        opacity: 1;
    }

    &:hover {
        background: rgba($color-brand-primary, 0.08);
        border-color: $color-brand-primary;
        color: $color-brand-primary;
    }
}

// ============================================
// MOBILE LIST VIEW
// ============================================
.mobile-list-view {
    display: none;
    padding: 0 $admin-space-md $admin-space-md;

    @media (max-width: 768px) {
        display: block;
    }
}

.mobile-slot-card {
    cursor: pointer;
    transition: all $transition-fast;

    &:hover {
        transform: translateY(-2px);
        box-shadow: $shadow-md;
    }

    &.available {
        border-left: 3px solid $accent-green;
    }

    &.booked {
        border-left: 3px solid $accent-orange;
    }

    &.unavailable {
        border-left: 3px solid $color-gray-400;
        opacity: 0.7;
    }
}

.mobile-slot-date {
    display: flex;
    flex-direction: column;
    gap: 2px;

    strong {
        font-size: 0.8125rem;
        color: $color-text-primary;
    }

    span {
        font-size: 0.6875rem;
        color: $color-text-tertiary;
    }
}

.mobile-slot-bookings {
    margin-top: $admin-space-xs;
    padding-top: $admin-space-xs;
    border-top: 1px solid $border-default;
}

.booking-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: $admin-space-2xs 0;
    font-size: 0.75rem;

    strong {
        color: $color-text-primary;
    }

    span {
        font-size: 0.6875rem;
        font-weight: 600;
    }
}

// ============================================
// MODAL EXTENSIONS
// ============================================
.pattern-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: $admin-space-xs;

    @media (min-width: 480px) {
        grid-template-columns: repeat(4, 1fr);
    }

    .admin-chip {
        flex-direction: column;
        padding: $admin-space-sm;
        gap: $admin-space-2xs;

        app-icon {
            font-size: 1.25rem;
        }

        small {
            font-size: 0.625rem;
        }
    }
}

.slot-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: $admin-space-sm;
    padding-bottom: $admin-space-sm;
    border-bottom: 1px solid $border-default;
    margin-bottom: $admin-space-sm;
}

.detail-date {
    display: flex;
    flex-direction: column;
    gap: 2px;

    strong {
        font-size: 0.9375rem;
        color: $color-text-primary;
    }

    span {
        font-size: 0.8125rem;
        color: $color-brand-primary;
        font-weight: 600;
    }
}

.detail-status {
    flex-shrink: 0;
}

.slot-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: $admin-space-sm;
    margin-bottom: $admin-space-md;

    @media (min-width: 480px) {
        grid-template-columns: repeat(3, 1fr);
    }
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: $admin-space-xs;
    background: $color-gray-50;
    border-radius: $radius-sm;

    label {
        font-size: 0.625rem;
        font-weight: 600;
        color: $color-text-tertiary;
        text-transform: uppercase;
        letter-spacing: 0.02em;
    }

    strong {
        font-size: 0.875rem;
        color: $color-text-primary;
    }
}

.meet-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: $color-brand-primary;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;

    &:hover {
        text-decoration: underline;
    }

    app-icon {
        font-size: 1rem;
    }
}

.bookings-section {
    margin-top: $admin-space-md;
    padding-top: $admin-space-md;
    border-top: 1px solid $border-default;

    > h3 {
        display: flex;
        align-items: center;
        gap: $admin-space-xs;
        font-size: 0.875rem;
        font-weight: 700;
        color: $color-text-primary;
        margin: 0 0 $admin-space-sm;

        app-icon {
            font-size: 1rem;
            color: $color-brand-primary;
        }
    }
}

.booking-detail {
    display: flex;
    align-items: center;
    gap: $admin-space-xs;
    font-size: 0.75rem;
    color: $color-text-secondary;
    padding: $admin-space-2xs 0;

    app-icon {
        font-size: 0.875rem;
        color: $color-text-tertiary;
    }

    &.booking-message {
        background: $color-gray-50;
        padding: $admin-space-xs;
        border-radius: $radius-sm;
        margin-top: $admin-space-2xs;
    }
}

// Day Modal specific
.slot-time-range {
    font-size: 0.875rem;

    strong {
        color: $color-brand-primary;
    }
}

.slot-status-info {
    display: flex;
    align-items: center;
    gap: $admin-space-xs;
    font-size: 0.75rem;
    color: $color-text-secondary;
}

.slot-booking-preview {
    margin-top: $admin-space-xs;
    padding-top: $admin-space-xs;
    border-top: 1px solid $border-default;

    small {
        font-size: 0.625rem;
        color: $color-text-tertiary;
        text-transform: uppercase;
        font-weight: 600;
    }
}

.booking-names {
    font-size: 0.75rem;
    color: $color-text-primary;
    margin-top: 2px;
}

// ============================================
// SEARCH BOX EXTENSION
// ============================================
.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.8125rem;
    color: $color-text-primary;
    outline: none;

    &::placeholder {
        color: $color-text-tertiary;
    }
}

.search-icon {
    color: $color-text-tertiary;
    font-size: 1rem;
}

.clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    border-radius: $radius-sm;
    color: $color-text-tertiary;
    cursor: pointer;
    transition: all $transition-fast;

    app-icon {
        font-size: 0.875rem;
    }

    &:hover {
        background: $color-gray-200;
        color: $color-text-primary;
    }
}

// ============================================
// UTILITIES
// ============================================
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

// ============================================
// RESPONSIVE
// ============================================
@media (max-width: 640px) {
    .calendar-nav {
        padding: $admin-space-xs;
    }

    .nav-center h2 {
        font-size: 0.8125rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
