/**
 * APC Calendar - Component Styles
 * Modals, forms, notifications
 */

/* Modal */
.apc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.apc-modal.show {
    display: flex;
}

.apc-modal-content {
    background: var(--apc-white);
    border-radius: var(--apc-radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    /* Limit height */
    padding: 0;
    /* Remove padding from container to let children handle it */
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Hide overflow on container */
}

.apc-modal-header {
    padding: var(--apc-spacing-xl);
    border-bottom: 1px solid var(--apc-border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    /* Don't shrink header */
}

.apc-modal-body {
    padding: var(--apc-spacing-xl);
    overflow-y: auto;
    /* Scrollable body */
    flex: 1;
    /* Take remaining space */
}

.apc-modal-footer {
    padding: var(--apc-spacing-xl);
    border-top: 1px solid var(--apc-border-light);
    display: flex;
    justify-content: flex-end;
    gap: var(--apc-spacing-md);
    flex-shrink: 0;
    /* Don't shrink footer */
}


.apc-modal-title {
    margin: 0;
    font-size: 1.25rem;
    color: var(--apc-gray-900);
}

.apc-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--apc-gray-500);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--apc-radius-md);
    transition: var(--apc-transition);
}

.apc-modal-close:hover {
    background: var(--apc-gray-100);
    color: var(--apc-gray-900);
}

/* Notifications */
.apc-notification-wrapper {
    position: relative;
    display: inline-block;
    margin-right: var(--apc-spacing-md);
    cursor: pointer;
}

.apc-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--apc-error);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    line-height: 18px;
    display: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.apc-notification-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 10px;
    background: white;
    border: 1px solid var(--apc-border-light);
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: var(--apc-shadow-lg);
    z-index: 10000;
    border-radius: var(--apc-radius-md);
}

.apc-notification-header {
    padding: var(--apc-spacing-md);
    border-bottom: 1px solid var(--apc-border-light);
    font-weight: 600;
    color: var(--apc-gray-900);
    background: var(--apc-gray-50);
}

.apc-notification-item {
    padding: var(--apc-spacing-md);
    border-bottom: 1px solid var(--apc-border-light);
    transition: background 0.2s;
}

.apc-notification-item:hover {
    background: var(--apc-gray-50);
}

.apc-notification-item.unread {
    background: var(--apc-warning-light);
    /* Or similar light orange/yellow */
}

.apc-notification-actions {
    margin-top: var(--apc-spacing-sm);
    display: flex;
    justify-content: flex-end;
    gap: var(--apc-spacing-sm);
}

.apc-notification-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 4px;
}

.apc-notification-btn.accept {
    color: var(--apc-success);
}

.apc-notification-btn.accept:hover {
    background: rgba(0, 200, 83, 0.1);
}

.apc-notification-btn.reject {
    color: var(--apc-error);
}

.apc-notification-btn.reject:hover {
    background: rgba(229, 57, 53, 0.1);
}

.apc-notification-btn.read {
    color: var(--apc-gray-600);
}

color: var(--apc-gray-900);
}

.apc-modal-body {
    margin-bottom: var(--apc-spacing-lg);
}

.apc-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--apc-spacing-md);
    padding-top: var(--apc-spacing-lg);
    border-top: 1px solid var(--apc-gray-200);
}

/* Notification Toast */
.apc-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 500px;
    padding: var(--apc-spacing-md) var(--apc-spacing-lg);
    border-radius: var(--apc-radius-md);
    box-shadow: var(--apc-shadow-xl);
    display: none;
    align-items: center;
    gap: var(--apc-spacing-md);
    z-index: 10000;
    animation: apc-slide-in 0.3s ease;
}

.apc-notification.show {
    display: flex;
}

@keyframes apc-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.apc-notification.success {
    background: var(--apc-success);
    color: var(--apc-white);
}

.apc-notification.error {
    background: var(--apc-error);
    color: var(--apc-white);
}

.apc-notification.warning {
    background: var(--apc-warning);
    color: var(--apc-white);
}

.apc-notification-icon {
    font-size: 1.5rem;
}

.apc-notification-content {
    flex: 1;
}

.apc-notification-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    opacity: 0.8;
}

.apc-notification-close:hover {
    opacity: 1;
}

/* Filter Panel */
.apc-filter-panel {
    background: var(--apc-white);
    border: 1px solid var(--apc-gray-300);
    border-radius: var(--apc-radius-lg);
    padding: var(--apc-spacing-lg);
    margin-bottom: var(--apc-spacing-lg);
}

.apc-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--apc-spacing-md);
    margin-bottom: var(--apc-spacing-md);
}

.apc-filter-actions {
    display: flex;
    gap: var(--apc-spacing-sm);
    justify-content: flex-end;
}

/* Color Picker */
.apc-color-picker {
    display: flex;
    gap: var(--apc-spacing-sm);
    flex-wrap: wrap;
}

.apc-color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--apc-transition);
}

.apc-color-option:hover {
    transform: scale(1.1);
}

.apc-color-option.selected {
    border-color: var(--apc-gray-900);
    box-shadow: 0 0 0 2px var(--apc-white), 0 0 0 4px var(--apc-gray-900);
}

/* Table */
.apc-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--apc-white);
    border-radius: var(--apc-radius-lg);
    overflow: hidden;
    box-shadow: var(--apc-shadow-md);
}

.apc-table th,
.apc-table td {
    padding: var(--apc-spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--apc-gray-200);
}

.apc-table th {
    background: var(--apc-gray-100);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--apc-gray-700);
    text-transform: uppercase;
}

.apc-table tr:last-child td {
    border-bottom: none;
}

.apc-table tr:hover {
    background: var(--apc-gray-50);
}

.apc-table-actions {
    display: flex;
    gap: var(--apc-spacing-sm);
}

/* Badge */
.apc-badge {
    display: inline-block;
    padding: var(--apc-spacing-xs) var(--apc-spacing-sm);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--apc-radius-sm);
    text-transform: uppercase;
}

.apc-badge-primary {
    background: var(--apc-primary);
    color: var(--apc-white);
}

.apc-badge-success {
    background: var(--apc-success);
    color: var(--apc-white);
}

.apc-badge-warning {
    background: var(--apc-warning);
    color: var(--apc-white);
}

.apc-badge-error {
    background: var(--apc-error);
    color: var(--apc-white);
}

/* Form Color Options (Radio based) */
.apc-color-options {
    display: flex;
    gap: var(--apc-spacing-md);
}

.apc-color-options label {
    cursor: pointer;
    position: relative;
    display: block;
}

.apc-color-options input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.apc-color-circle {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.apc-color-options input[type="radio"]:checked+.apc-color-circle {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px var(--apc-white), 0 0 0 4px var(--apc-gray-900);
}