/**
 * Swift Key Dates - Frontend Styles
 * Version: 2.0.0
 */

/* Core Components */
.swift-key-date {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.swift-key-date:hover {
    border-color: #154B75;
    box-shadow: 0 4px 12px rgba(21, 75, 117, 0.1);
}

.swift-key-date h4 {
    margin: 0 0 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1d2327;
    line-height: 1.4;
}

.swift-key-date p {
    margin: 0.5rem 0;
    color: #555;
    line-height: 1.6;
}

.swift-key-date p:last-child {
    margin-bottom: 0;
}

.swift-key-date strong {
    color: #154B75;
    font-weight: 600;
}

/* Date Display */
.swift-key-date-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #154B75;
}

/* Group Specific Styles */
.swift-key-date--start-dates {
    border-left: 4px solid #28a745;
}

.swift-key-date--start-dates .swift-key-date-value {
    color: #28a745;
}

.swift-key-date--deadlines {
    border-left: 4px solid #dc3545;
}

.swift-key-date--deadlines .swift-key-date-value {
    color: #dc3545;
}

/* List Layout */
.swift-key-dates-list {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .swift-key-dates-list {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.5rem;
    }
}

/* Inline Field Display */
.swift-key-date-field {
    display: inline;
    font-weight: 600;
    color: #154B75;
}

/* Loading States */
.swift-key-dates-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.swift-key-dates-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #154B75;
    border-radius: 50%;
    animation: swift-loading-spin 1s linear infinite;
}

@keyframes swift-loading-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.swift-key-dates-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin: 1rem 0;
    font-size: 0.875rem;
}

/* No Results */
.swift-key-dates-empty {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-style: italic;
}

/* Accessibility */
.swift-key-date:focus-within {
    outline: 2px solid #154B75;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .swift-key-date {
        background: #fff;
        border: 1px solid #000;
        box-shadow: none;
        page-break-inside: avoid;
    }

    .swift-key-date--start-dates,
    .swift-key-date--deadlines {
        border-left-width: 2px;
        border-left-color: #000;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .swift-key-date {
        border-color: #000;
    }

    .swift-key-date strong,
    .swift-key-date-value {
        color: #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .swift-key-date,
    .swift-key-dates-loading::after {
        transition: none;
        animation: none;
    }
}