/**
 * Excel Display Plugin - Frontend Styles
 */

/* Container */
.edp-container {
    position: relative;
    margin: 2rem 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Refresh Indicator */
.edp-refresh-indicator {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #666;
    background: #f8f9fa;
    border-radius: 4px 4px 0 0;
    border-bottom: 1px solid #e0e0e0;
}

.edp-refresh-text {
    font-weight: 500;
}

.edp-refresh-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid #e0e0e0;
    border-top-color: #4CAF50;
    border-radius: 50%;
    animation: edp-spin 1s linear infinite;
    opacity: 0;
    transition: opacity 0.3s;
}

.edp-refreshing .edp-refresh-spinner {
    opacity: 1;
}

.edp-success .edp-refresh-indicator {
    background: #e8f5e9;
    border-bottom-color: #4CAF50;
}

.edp-error .edp-refresh-indicator {
    background: #ffebee;
    border-bottom-color: #f44336;
}

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

/* Content Container */
.edp-content {
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

.edp-container:not(:has(.edp-refresh-indicator)) .edp-content {
    border-top: 1px solid #e0e0e0;
    border-radius: 4px;
}

/* Grid Layout */
.edp-grid {
    display: grid;
    grid-template-columns: repeat(var(--edp-columns, 3), 1fr);
    gap: 1.5rem;
}

.edp-grid-item {
    background: #fff;
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.edp-grid-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* List Layout */
.edp-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.edp-list-item {
    background: #fff;
    padding: 1.25rem;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #4CAF50;
    border-radius: 4px;
    transition: border-left-color 0.2s;
}

.edp-list-item:hover {
    border-left-color: #2196F3;
}

/* Field Styling */
.edp-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.75rem;
}

.edp-field:last-child {
    margin-bottom: 0;
}

.edp-field-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.edp-field-value {
    font-size: 1rem;
    color: #333;
    word-wrap: break-word;
}

/* Table Layout */
.edp-table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.edp-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.edp-table thead {
    background: #f8f9fa;
}

.edp-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

.edp-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
}

.edp-table tbody tr:hover {
    background: #f8f9fa;
}

.edp-table tbody tr:last-child td {
    border-bottom: none;
}

/* Error Message */
.edp-error {
    padding: 1rem;
    background: #ffebee;
    border: 1px solid #f44336;
    border-radius: 4px;
    color: #c62828;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .edp-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .edp-grid {
        grid-template-columns: 1fr;
    }

    .edp-content {
        padding: 1rem;
    }

    .edp-grid-item,
    .edp-list-item {
        padding: 1rem;
    }

    .edp-table th,
    .edp-table td {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .edp-refresh-indicator {
        font-size: 0.75rem;
        padding: 0.5rem;
    }

    .edp-field-label {
        font-size: 0.75rem;
    }

    .edp-field-value {
        font-size: 0.875rem;
    }
}

/* Loading Animation */
.edp-content.edp-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Fade Transitions */
.edp-content > * {
    animation: edp-fade-in 0.3s ease-in;
}

@keyframes edp-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
