/* Safe Granda MS Events - Frontend Styles */

/* General Widget Styling */
.sfgdev-widget {
    margin-bottom: 20px;
}

/* Event List Widget */
.sfgdev-events-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.sfgdev-event-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.sfgdev-event-item:hover {
    transform: translateY(-5px);
}

.sfgdev-event-image {
    height: 200px;
    background-size: cover;
    background-position: center;
}

.sfgdev-event-content {
    padding: 20px;
}

.sfgdev-event-date {
    color: #0073aa;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.sfgdev-event-title {
    margin: 0 0 10px 0;
    font-size: 1.2em;
}

.sfgdev-event-title a {
    text-decoration: none;
    color: #333;
}

.sfgdev-event-meta {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 15px;
}

.sfgdev-event-meta i {
    margin-right: 5px;
    width: 16px;
    text-align: center;
}

/* Event Meta Widget */
.sfgdev-meta-box {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
}

.sfgdev-meta-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.sfgdev-meta-item:last-child {
    margin-bottom: 0;
}

.sfgdev-meta-icon {
    margin-right: 15px;
    color: #0073aa;
    font-size: 1.2em;
    width: 24px;
    text-align: center;
}

.sfgdev-meta-content h4 {
    margin: 0 0 5px 0;
    font-size: 0.9em;
    text-transform: uppercase;
    color: #666;
}

.sfgdev-meta-content p {
    margin: 0;
    font-size: 1em;
    color: #333;
}

/* Event Participants Widget */
.sfgdev-event-participants-widget {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sfgdev-join-action {
    width: 100%;
}

.sfgdev-join-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s ease;
    width: 100%;
    text-align: center;
}

.sfgdev-join-btn:hover {
    background: #005177;
    color: #fff;
}

.sfgdev-join-btn.joined {
    background: #d63638;
}

.sfgdev-join-btn.joined:hover {
    background: #a82a2b;
}

.sfgdev-join-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.sfgdev-participants-avatars {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    /* Overlap handled by negative margin */
}

.sfgdev-participant-avatar {
    position: relative;
    margin-left: -10px;
    /* Overlap */
    transition: transform 0.2s ease, z-index 0.2s ease;
}

.sfgdev-participant-avatar:first-child {
    margin-left: 0;
}

.sfgdev-participant-avatar:hover {
    transform: translateY(-3px);
    z-index: 10;
}

.sfgdev-participant-avatar img {
    display: block;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    background: #fff;
}

.sfgdev-participants-count {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    background: #0ea5e9;
    color: #fff;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    margin-left: -10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1;
    border: 2px solid #fff;
}

.sfgdev-no-participants {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f1f5f9;
    border-radius: 50%;
    color: #94a3b8;
    font-size: 20px;
}

/* Map Widget */
.sfgdev-map-container {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
}

/* Event Location Map Widget */
.sfgdev-event-location-wrapper {
    width: 100%;
}

.sfgdev-event-location-map {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
}

.sfgdev-event-location-text {
    margin: 15px 0 0 0;
    padding: 0;
}

/* Elementor Editor Notice */
.sfgdev-elementor-notice {
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    margin: 10px 0;
}

.sfgdev-elementor-notice p {
    margin: 0;
}

/* Registration Form */
.sfgdev-registration-form {
    max-width: 400px;
    margin: 0 auto;
}

.sfgdev-form-group {
    margin-bottom: 15px;
}

.sfgdev-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.sfgdev-form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.sfgdev-form-submit {
    width: 100%;
    padding: 12px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.sfgdev-form-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

.sfgdev-form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.sfgdev-form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Events Calendar Widget */
.sfgdev-calendar-wrapper {
    margin: 2rem 0;
}

.sfgdev-calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.sfgdev-view-toggle {
    display: flex;
    gap: 0.5rem;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 6px;
}

.sfgdev-view-btn {
    padding: 0.5rem 1.5rem;
    border: none;
    background: transparent;
    color: #334155;
    cursor: pointer;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sfgdev-view-btn.active {
    background: #0f87ff;
    color: #fff;
}

.sfgdev-view-btn:hover:not(.active) {
    background: #e2e8f0;
}

.sfgdev-calendar {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sfgdev-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: #0f87ff;
    color: #fff;
}

.sfgdev-calendar-title {
    margin: 0;
    font-size: 1.875rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.sfgdev-calendar-nav-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sfgdev-cal-nav {
    background-color: #5eead4;
    border: none;
    color: #ffffff;
    padding: 0.5rem;
    width: 32px;
    height: 32px;
    box-sizing: border-box;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
}

.sfgdev-cal-nav .screen-reader-text {
    position: absolute;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.sfgdev-cal-nav svg {
    width: 14px;
    height: 14px;
    display: block;
    stroke: currentColor;
    fill: none;
    pointer-events: none;
    flex-shrink: 0;
    overflow: visible;
}

.sfgdev-cal-nav svg path {
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.sfgdev-cal-nav:hover {
    background-color: #2dd4bf;
    transform: translateY(-1px);
}

.sfgdev-cal-nav:active {
    transform: translateY(0);
    background-color: #14b8a6;
}

.sfgdev-calendar-grid {
    display: grid;
    grid-template-columns: auto repeat(7, 1fr);
    gap: 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
}

.sfgdev-calendar-week-number {
    background: #fff;
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sfgdev-calendar-day-header {
    background: #fff;
    padding: 0.875rem 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: #1f2937;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.sfgdev-calendar-cell {
    background: #fff;
    min-height: 120px;
    padding: 0.625rem;
    position: relative;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.sfgdev-calendar-cell.sfgdev-empty {
    background: #fafafa;
    color: #d1d5db;
}

.sfgdev-calendar-cell.sfgdev-today {
    background: #eff6ff;
}

.sfgdev-calendar-cell.sfgdev-today .sfgdev-day-number {
    background: #0f87ff;
    color: #fff;
    font-weight: 700;
    width: 36px;
    height: 36px;
}

.sfgdev-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.sfgdev-day-events {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.sfgdev-calendar-event {
    display: block;
    background: #dbeafe;
    color: #1e40af;
    padding: 0.5rem 0.625rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    text-decoration: none;
    transition: all 0.2s ease;
    overflow: hidden;
    line-height: 1.4;
    border: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sfgdev-calendar-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    opacity: 0.9;
}

/* Event color variations */
.sfgdev-calendar-event:nth-child(1) {
    background: #dbeafe;
    color: #1e40af;
}

.sfgdev-calendar-event:nth-child(2) {
    background: #fef3c7;
    color: #92400e;
}

.sfgdev-calendar-event:nth-child(3) {
    background: #fed7aa;
    color: #9a3412;
}

.sfgdev-calendar-event:nth-child(4) {
    background: #fecaca;
    color: #991b1b;
}

.sfgdev-calendar-event:nth-child(5) {
    background: #e9d5ff;
    color: #6b21a8;
}

.sfgdev-event-title {
    font-weight: 700;
    font-size: 0.875rem;
    display: block;
    margin-bottom: 0.25rem;
    line-height: 1;
}

.sfgdev-event-time {
    font-weight: 500;
    font-size: 0.75rem;
    margin-bottom: 0.125rem;
    opacity: 0.9;
}

.sfgdev-event-location {
    font-weight: 400;
    font-size: 0.6875rem;
    display: block;
    opacity: 0.8;
    margin-top: 0.125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* List View */
.sfgdev-events-list-view {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sfgdev-event-list-item {
    display: flex;
    gap: 1.5rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.2s ease;
}

.sfgdev-event-list-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sfgdev-event-date-badge {
    flex-shrink: 0;
    width: 70px;
    text-align: center;
    background: #0f87ff;
    color: #fff;
    border-radius: 6px;
    padding: 0.75rem 0.5rem;
}

.sfgdev-badge-month {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.sfgdev-badge-day {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.sfgdev-event-list-content {
    flex: 1;
}

.sfgdev-event-list-content h3 {
    margin: 0 0 0.75rem;
    font-size: 1.5rem;
}

.sfgdev-event-list-content h3 a {
    color: #0f172a;
    text-decoration: none;
}

.sfgdev-event-list-content h3 a:hover {
    color: #0f87ff;
}

.sfgdev-event-list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #64748b;
}

.sfgdev-event-list-meta .sfgdev-meta-item {
    margin-bottom: 0;
}

.sfgdev-event-excerpt {
    margin-bottom: 1rem;
    color: #64748b;
    line-height: 1.6;
}

.sfgdev-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #0f87ff;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.sfgdev-button:hover {
    background: #0d6ed1;
    color: #fff;
}

.sfgdev-pagination {
    margin-top: 2rem;
    text-align: center;
}

.sfgdev-pagination .page-numbers {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    text-decoration: none;
    color: #1f2937;
    transition: all 0.2s ease;
}

.sfgdev-pagination .page-numbers:hover,
.sfgdev-pagination .page-numbers.current {
    background: #0f87ff;
    color: #fff;
    border-color: #0f87ff;
}

/* Responsive */
@media (max-width: 768px) {
    .sfgdev-calendar-grid {
        font-size: 0.75rem;
    }

    .sfgdev-calendar-cell {
        min-height: 80px;
        padding: 0.25rem;
    }

    .sfgdev-calendar-event {
        font-size: 0.65rem;
        padding: 0.15rem 0.25rem;
    }

    .sfgdev-event-time,
    .sfgdev-event-location {
        font-size: 0.6rem;
    }

    .sfgdev-event-list-item {
        flex-direction: column;
        gap: 1rem;
    }

    .sfgdev-event-date-badge {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
    }

    .sfgdev-badge-day {
        font-size: 1.5rem;
    }
}

/* Event Venue Maps Widget */
.sfgdev-venue-maps-container {
    width: 100%;
}

.sfgdev-venue-item {
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.sfgdev-venue-map {
    width: 100%;
    height: 400px;
    background: #e5e7eb;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.sfgdev-venue-info {
    padding: 1.5rem;
}

.sfgdev-venue-name {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

.sfgdev-venue-address {
    margin: 0;
    font-size: 1rem;
    color: #6b7280;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .sfgdev-venue-map {
        height: 300px;
    }

    .sfgdev-venue-info {
        padding: 1rem;
    }

    .sfgdev-venue-name {
        font-size: 1.25rem;
    }

    .sfgdev-venue-address {
        font-size: 0.9rem;
    }
}