/**
 * Estilos para Widgets SGC Canil Integration
 */

/* Grid Base */
.sgc-grid {
    display: grid;
    gap: 20px;
    padding: 20px 0;
}

.sgc-grid--1-cols {
    grid-template-columns: 1fr;
}

.sgc-grid--2-cols {
    grid-template-columns: repeat(2, 1fr);
}

.sgc-grid--3-cols {
    grid-template-columns: repeat(3, 1fr);
}

.sgc-grid--4-cols {
    grid-template-columns: repeat(4, 1fr);
}

/* Responsividade */
@media (max-width: 768px) {
    .sgc-grid--4-cols,
    .sgc-grid--3-cols {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .sgc-grid--4-cols,
    .sgc-grid--3-cols,
    .sgc-grid--2-cols {
        grid-template-columns: 1fr;
    }
}

/* Card */
.sgc-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sgc-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.sgc-card--reserved {
    opacity: 0.8;
    border-color: #ccc;
}

.sgc-card__image {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sgc-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sgc-card:hover .sgc-card__image img {
    transform: scale(1.05);
}

.sgc-card__badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff6b6b;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.sgc-card__content {
    padding: 15px;
}

.sgc-card__title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.sgc-card__info {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* Erro e Vazio */
.sgc-error,
.sgc-calendar__empty {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    color: #666;
    font-size: 14px;
}

.sgc-error {
    background: #ffe9e9;
    border-color: #ffcccc;
    color: #d63031;
}

/* Calendário */
.sgc-calendar {
    width: 100%;
    overflow-x: auto;
}

.sgc-calendar__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sgc-calendar__table thead {
    background: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
}

.sgc-calendar__table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
}

.sgc-calendar__table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    color: #666;
}

.sgc-calendar__table tbody tr:hover {
    background: #f9f9f9;
}

/* Badge */
.sgc-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.sgc-badge--pendente {
    background: #fff3cd;
    color: #856404;
}

.sgc-badge--confirmado {
    background: #d4edda;
    color: #155724;
}

.sgc-badge--nascimento {
    background: #d1ecf1;
    color: #0c5460;
}

.sgc-badge--reservado {
    background: #f8d7da;
    color: #721c24;
}

.sgc-badge--vendido {
    background: #e2e3e5;
    color: #383d41;
}

/* Widget Container */
.sgc-widget-filhotes-disponiveis,
.sgc-widget-filhotes-reservados,
.sgc-widget-padreadores,
.sgc-widget-matrizes,
.sgc-widget-calendario-ninhadas {
    margin: 20px 0;
}

.sgc-widget-filhotes-disponiveis .widget-title,
.sgc-widget-filhotes-reservados .widget-title,
.sgc-widget-padreadores .widget-title,
.sgc-widget-matrizes .widget-title,
.sgc-widget-calendario-ninhadas .widget-title {
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

/* Alerta de Proximidade de Ninhadas */
.sgc-preview-urgente {
    background: #ff4444 !important;
    color: #ffffff !important;
    font-weight: bold !important;
    border-radius: 4px !important;
    padding: 8px !important;
}

.sgc-preview-proximo-intenso {
    background: #ff8800 !important;
    color: #ffffff !important;
    font-weight: bold !important;
    border-radius: 4px !important;
    padding: 8px !important;
}

.sgc-preview-proximo {
    background: #ffcc00 !important;
    color: #333333 !important;
    font-weight: bold !important;
    border-radius: 4px !important;
    padding: 8px !important;
}

.sgc-preview-medio {
    background: #ffffcc !important;
    color: #333333 !important;
    font-weight: bold !important;
    border-radius: 4px !important;
    padding: 8px !important;
}

.sgc-preview-distante {
    background: #ccffcc !important;
    color: #333333 !important;
    font-weight: bold !important;
    border-radius: 4px !important;
    padding: 8px !important;
}

.sgc-preview-muito-distante {
    background: #ccffff !important;
    color: #333333 !important;
    font-weight: bold !important;
    border-radius: 4px !important;
    padding: 8px !important;
}

/* Carregando */
.sgc-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility */
.sgc-card__image img {
    display: block;
}

.sgc-card__title {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Print Styles */
@media print {
    .sgc-card:hover {
        box-shadow: none;
        transform: none;
    }
    
    .sgc-card__image img {
        transform: none;
    }
}
