/* ============================================
   Shared Dialog Layout Styles
   Used by both EventDialog and CalendarDialog
   ============================================ */

/* Base Dialog Container */
.dialog-container {
    display: flex;
    flex-direction: column;
    min-width: 500px;
}

/* Field Rows - Standard Layout Pattern */
.dialog-section {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--use-stroke-neutral-1);
}

.field-row {
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-3);
    padding: var(--spacing-4) var(--spacing-4);
}

.field-icon {
    flex-shrink: 0;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.field-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.field-action {
    flex-shrink: 0;
    width: 6rem;
}

/* Date and Time Inputs */
.date-range,
.time-range {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.time-input {
    border: none;
    outline: none;
    font-size: var(--size-b2);
    color: var(--use-text-positive-loud);
    padding: var(--spacing-1) var(--spacing-2);
    border-radius: var(--radius-sm);
    background-color: transparent;
    cursor: pointer;
}

.time-input:hover {
    background-color: var(--use-action-1);
}

.time-input:disabled {
    color: var(--use-text-positive-soft);
    cursor: not-allowed;
    background-color: transparent;
}

.separator {
    color: var(--use-text-positive-soft);
    font-size: var(--size-b2);
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    cursor: pointer;
    font-size: var(--size-b2);
    color: var(--use-text-positive-medium);
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Select Inputs */
.calendar-select,
.repeat-select,
.notification-select,
.notification-time-select {
    border: none;
    outline: none;
    font-size: var(--size-b2);
    color: var(--use-text-positive-loud);
    padding: var(--spacing-1) var(--spacing-2);
    border-radius: var(--radius-sm);
    background-color: transparent;
    cursor: pointer;
}

.calendar-select:hover,
.repeat-select:hover,
.notification-select:hover,
.notification-time-select:hover {
    background-color: var(--use-action-1);
}

.calendar-select {
    flex: 1;
}

.repeat-select {
    flex: 1;
}

.notification-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.notification-time-select {
    flex: 0 0 auto;
}

.notification-unit {
    font-size: var(--size-b2);
    color: var(--use-text-positive-medium);
}

/* Add Time Button */
.add-time-btn {
    width: 100%;
    padding: var(--spacing-3) var(--spacing-4);
    background-color: var(--use-background-300);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--size-b2);
    font-weight: 500;
    color: var(--use-text-positive-medium);
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.add-time-btn:hover:not(:disabled) {
    background-color: var(--use-action-1);
}

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

/* Remove Time Button */
.remove-time-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-1);
    background-color: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.remove-time-btn:hover:not(:disabled) {
    background-color: var(--use-action-1);
}

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

/* Pill Buttons for Type Selection */
.pill-toggle {
    display: flex;
    gap: var(--spacing-2);
}

.pill-button {
    padding: var(--spacing-2) var(--spacing-4);
    border: none;
    border-radius: var(--radius-pill);
    background-color: transparent;
    color: var(--use-text-positive-medium);
    font-size: var(--size-b2);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pill-button:hover {
    background-color: var(--use-action-1);
}

.pill-button.active {
    background-color: var(--use-text-positive-loud);
    color: var(--use-text-negative-loud);
}

/* Color Picker Grid */
.color-picker-grid {
    display: flex;
    gap: var(--spacing-2);
    flex-wrap: wrap;
}

.color-swatch {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.color-swatch:hover {
    transform: scale(1.05);
    border-color: var(--use-stroke-neutral-2);
}

.color-swatch.selected {
    border-color: var(--use-stroke-accent-1);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Preview Section */
.calendar-preview {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-3);
    background-color: var(--use-background-200);
    border-radius: var(--radius-lg);
    border: 1px solid var(--use-stroke-neutral-1);
}

.calendar-preview-color {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--use-stroke-neutral-2);
    flex-shrink: 0;
}

.calendar-preview-name {
    font-size: var(--size-b2);
    font-weight: 500;
    color: var(--use-text-positive-loud);
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .pill-button.active {
        background-color: var(--use-surface-accent-loud);
        color: var(--use-text-positive-loud);
    }

    .pill-button:hover,
    .time-input:hover,
    .calendar-select:hover,
    .repeat-select:hover,
    .notification-select:hover,
    .notification-time-select:hover {
        background-color: var(--use-surface-accent-soft);
    }
}

/* Animation for dropdown appearance */
@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
