/* InTheOffice - Custom Styles */

body {
    font-family: 'Inter', sans-serif;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Transitions */
.transition-default {
    transition: all 0.2s ease-in-out;
}

/* Button hover effects */
.btn-hover:hover {
    transform: scale(1.02);
}

.btn-hover:active {
    transform: scale(0.98);
}

/* Card styles */
.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

/* Avatar styles */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

.avatar-sm {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
}

.avatar-md {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.875rem;
}

.avatar-lg {
    width: 3rem;
    height: 3rem;
    font-size: 1rem;
}

/* Day toggle button */
.day-toggle {
    transition: all 0.2s ease-in-out;
}

.day-toggle:hover {
    transform: scale(1.05);
}

.day-toggle.active {
    background-color: #2563eb;
    color: white;
}

.day-toggle.inactive {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* Tabs */
.tab {
    transition: all 0.2s ease-in-out;
    border-bottom: 2px solid transparent;
}

.tab.active {
    border-bottom-color: #2563eb;
    color: #2563eb;
}

.tab:hover:not(.active) {
    color: #374151;
}

/* Flash messages */
.flash {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease-out;
}

.flash-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.flash-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

.flash-info {
    background-color: #eff6ff;
    border: 1px solid #dbeafe;
    color: #1e40af;
}

/* Form styles */
.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

/* Sidebar */
.sidebar {
    width: 288px;
    min-width: 288px;
    background: white;
    border-right: 1px solid #e5e7eb;
    height: 100vh;
    overflow-y: auto;
}

/* Nav bar */
.nav-bar {
    width: 56px;
    min-width: 56px;
    background: white;
    border-right: 1px solid #e5e7eb;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
}

/* Week grid */
.week-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.25rem 0.5rem;
    background: #1f2937;
    color: white;
    font-size: 0.75rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 0.25rem;
}

.tooltip:hover::after {
    opacity: 1;
}



/* Loading spinner */
.spinner {
    border: 2px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    width: 1.25rem;
    height: 1.25rem;
    animation: spin 0.6s linear infinite;
}

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

/* Invite Modal */
.invite-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.invite-modal.active {
    display: flex;
}

.invite-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.invite-modal-content {
    position: relative;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    width: 100%;
    max-width: 480px;
    animation: fadeIn 0.2s ease-out;
    padding: 1.5rem;
}

.invite-modal-content > div:first-child {
    padding: 0;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    width: 100%;
    max-width: 480px;
    animation: fadeIn 0.2s ease-out;
    padding: 1.5rem;
}

.modal-content > div:first-child {
    padding: 0;
}

/* Button styles */
.btn-primary {
    background-color: #4f46e5;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #4338ca;
}

.btn-primary:disabled {
    background-color: #a5b4fc;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: white;
    color: #374151;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    border: 1px solid #d1d5db;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

/* Form textarea */
.form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 80px;
    resize: vertical;
}

.form-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    background-color: #2563eb;
    color: white;
}

/* Icon button */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background-color: #f3f4f6;
}

/* Search input */
.search-input {
    position: relative;
}

.search-input input {
    padding-left: 2.5rem;
}

.search-input svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

/* Mobile header */
.mobile-header {
    display: none;
}

/* Mobile overlay */
.mobile-overlay {
    display: none;
}

/* Responsive: Mobile (< 768px) */
@media (max-width: 767px) {
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        background: white;
        border-bottom: 1px solid #e5e7eb;
        position: sticky;
        top: 0;
        z-index: 40;
    }

    .nav-bar {
        display: none;
    }

    .sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        max-width: 320px;
        height: 100vh;
        z-index: 50;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
    }

    .sidebar.open {
        display: block;
    }

    .mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 45;
    }

    .mobile-overlay.open {
        display: block;
    }

    .flex.h-screen {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .flex-1.p-8 {
        padding: 1rem;
    }

    .week-grid {
        gap: 0.25rem;
    }

    .day-toggle {
        min-width: 0;
    }

    .day-toggle svg {
        width: 1.5rem;
        height: 1.5rem;
    }

    .max-w-4xl {
        max-width: 100%;
    }

    /* Stack week header on mobile */
    .week-header-desktop {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
}
