/* GMC Operations Plugin Admin Styles */

.gmc-profiles-header {
  display: flex;
  align-items: flex-start;
}

.gmc-profiles-title-block {
  flex: 0 0 auto;
  max-width: 40%;   /* tweak as you like */
}

.gmc-profiles-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: nowrap;  /* force single row */
  margin-left: auto;  /* pushes stats flush right */
}

.gmc-profile-stat-card {
  display: flex;
  align-items: center;
  background: #f8f9fa;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  white-space: nowrap; /* prevents wrapping inside a card */
}





.gmc-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

/* Three Column Overview Layout */
.gmc-overview-container {
    display: flex;
    gap: 30px;
    margin: 20px 0;
}

.gmc-overview-left {
    flex: 2;
    min-width: 0; /* Prevents flex item from overflowing */
}

.gmc-overview-right {
    flex: 1;
    min-width: 300px; /* Minimum width for Google cards */
}

/* Stats grid - full width at top */
.gmc-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0 30px 0;
    max-width: 100%;
}

/* Stat card styling */
.gmc-stat-card {
    background: #0073aa !important;
    color: white !important;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #005a87;
}

.gmc-stat-card:hover {
    background: #005a87 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.gmc-stat-number {
    font-size: 2.5em !important;
    font-weight: bold !important;
    line-height: 1;
    margin-bottom: 5px;
    color: white !important;
}

.gmc-stat-label {
    font-size: 0.9em !important;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white !important;
}

/* Quick Actions - inline buttons */
.gmc-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.gmc-quick-actions .button {
    margin: 0;
    flex: 0 0 auto;
}

/* Responsive design for overview */
@media (max-width: 1200px) {
    .gmc-overview-container {
        flex-direction: column;
    }
    
    .gmc-overview-right {
        min-width: auto;
    }
    
    .gmc-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .gmc-quick-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .gmc-quick-actions .button {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .gmc-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.gmc-stat-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    transition: transform 0.2s;
}

.gmc-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,.15);
}

.gmc-stat-card h3 {
    margin: 0 0 10px 0;
    color: #23282d;
    font-size: 14px;
    font-weight: 600;
}

.gmc-stat-number {
    font-size: 36px;
    font-weight: bold;
    color: #0073aa;
    line-height: 1;
}

.gmc-stat-label {
    margin: 8px 0 0 0;
    color: #666;
    font-size: 12px;
}

.gmc-dashboard-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.gmc-dashboard-section {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.gmc-dashboard-section h3 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    color: #23282d;
}

.gmc-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.gmc-recent-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gmc-recent-list li {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.gmc-recent-list li:last-child {
    border-bottom: none;
}

.gmc-amount {
    color: #0073aa;
    font-weight: 600;
}

.gmc-church-info p {
    margin: 5px 0;
}

/* Dashboard Tabs */
#gmc-dashboard-tabs {
    margin-top: 20px;
}

#gmc-dashboard-tabs .ui-tabs-nav {
    background: #f1f1f1;
    border-radius: 4px 4px 0 0;
}

#gmc-dashboard-tabs .ui-tabs-tab {
    border: none;
    background: transparent;
}

#gmc-dashboard-tabs .ui-tabs-tab.ui-tabs-active {
    background: #fff;
    border-bottom: 2px solid #0073aa;
}

#gmc-dashboard-tabs .ui-tabs-panel {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 0 0 4px 4px;
    padding: 20px;
}

/* Collections Dashboard */
.gmc-collections-dashboard,
.gmc-attendance-dashboard,
.gmc-calendar-dashboard,
.gmc-messaging-dashboard {
    max-width: 1200px;
}

.gmc-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.gmc-collections-summary,
.gmc-attendance-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.gmc-last-collection,
.gmc-last-attendance {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.gmc-collection-breakdown,
.gmc-attendance-breakdown {
    margin-top: 15px;
}

.gmc-collection-item,
.gmc-attendance-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.gmc-collection-item.total,
.gmc-attendance-item.total {
    border-top: 2px solid #0073aa;
    margin-top: 10px;
    padding-top: 15px;
    font-weight: bold;
    color: #0073aa;
}

.gmc-collections-chart,
.gmc-attendance-chart {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.gmc-collections-quick,
.gmc-attendance-quick {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

/* Summary Cards */
.gmc-collections-summary-cards,
.gmc-attendance-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.gmc-summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,.1);
}

.gmc-summary-card h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    opacity: 0.9;
}

.gmc-summary-amount {
    font-size: 28px;
    font-weight: bold;
}

/* Calendar Dashboard */
.gmc-events-list {
    max-height: 400px;
    overflow-y: auto;
}

.gmc-event-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #fff;
}

.gmc-event-date {
    background: #0073aa;
    color: white;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    margin-right: 15px;
    min-width: 60px;
}

.gmc-event-date .day {
    font-size: 20px;
    font-weight: bold;
    display: block;
}

.gmc-event-date .month {
    font-size: 12px;
    display: block;
}

.gmc-event-details h4 {
    margin: 0 0 5px 0;
    color: #23282d;
}

.gmc-event-details p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Messaging Dashboard */
.gmc-quick-sms {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.gmc-recent-messages {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.gmc-sms-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gmc-sms-list li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.gmc-sms-list li:last-child {
    border-bottom: none;
}

/* Filters */
.gmc-filters {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.gmc-filters form {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.gmc-filters select {
    min-width: 150px;
}

/* Forms */
.gmc-member-form .form-table,
.gmc-collection-form .form-table,
.gmc-attendance-form .form-table {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

/* Attendance form styling to match bulletins */
.attendance-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.attendance-fields {
    display: flex;
    flex-direction: row;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 0;
}

.attendance-fields p {
    margin: 0;
    flex: 0 0 auto;
}

.attendance-fields label {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 13px;
}

.attendance-fields input[type="number"] {
    width: 80px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

#child-fields {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

#child-fields h3 {
    margin-top: 0;
    color: #0073aa;
}

/* Committee Management */
.gmc-committees-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-top: 20px;
}

.gmc-committee-form,
.gmc-committees-list {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 20px;
}

.gmc-committee-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: #fff;
}

.gmc-committee-info {
    flex: 1;
}

.gmc-committee-info h3 {
    margin: 0 0 10px 0;
    color: #0073aa;
}

.gmc-committee-members ul {
    margin: 10px 0 0 20px;
}

.gmc-committee-actions {
    display: flex;
    gap: 5px;
}

/* Modal Styles */
#edit-committee-modal {
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.gmc-modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    border-radius: 8px;
    width: 50%;
    max-width: 600px;
    position: relative;
}

.gmc-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 10px;
}

.gmc-modal-close:hover,
.gmc-modal-close:focus {
    color: #000;
}

/* Groups and Messaging */
.gmc-groups-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.gmc-groups-section,
.gmc-group-management,
.gmc-messaging-section {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 20px;
}

.gmc-messaging-section {
    grid-column: 1 / -1;
}

.gmc-add-group {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    background: #f9f9f9;
}

.gmc-add-group h3 {
    margin-top: 0;
}

.gmc-groups-list {
    margin-top: 20px;
}

.gmc-add-members {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    background: #f9f9f9;
}

.gmc-add-members h3 {
    margin-top: 0;
}

.gmc-add-members form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gmc-add-members select {
    min-width: 250px;
}

.gmc-current-members h3 {
    margin-bottom: 15px;
}

/* Messaging Tabs */
.gmc-messaging-tabs {
    border-bottom: 1px solid #ccc;
    margin-bottom: 20px;
}

.gmc-tab-button {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-right: 10px;
    border-radius: 4px 4px 0 0;
    font-weight: 500;
}

.gmc-tab-button.active {
    border-bottom-color: #0073aa;
    color: #0073aa;
    font-weight: bold;
    background: #f8f9fa;
}

.gmc-tab-content {
    padding: 20px 0;
}

.description {
    font-style: italic;
    color: #666;
}

/* SMS Status Styles */
.gmc-status-sent {
    color: #46b450;
    font-weight: bold;
}

.gmc-status-failed {
    color: #dc3232;
    font-weight: bold;
}

.gmc-sms-logs {
    margin-top: 30px;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 20px;
}

/* Settings Styles */
.gmc-settings-info {
    margin: 20px 0;
}

.gmc-test-sms {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
}

.gmc-sms-usage {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
}

/* Enhanced Button Styles */
.button-primary {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    border-color: #005a87;
    box-shadow: 0 2px 4px rgba(0,115,170,.2);
}

.button-primary:hover {
    background: linear-gradient(135deg, #005a87 0%, #004a73 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,115,170,.3);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .gmc-collections-summary,
    .gmc-attendance-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .gmc-dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gmc-dashboard-sections {
        grid-template-columns: 1fr;
    }
    
    .gmc-committees-container {
        grid-template-columns: 1fr;
    }
    
    .gmc-groups-container {
        grid-template-columns: 1fr;
    }
    
    .gmc-messaging-section {
        grid-column: auto;
    }
    
    .gmc-modal-content {
        width: 90%;
        margin: 5% auto;
    }
    
    .gmc-filters form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .gmc-quick-actions {
        grid-template-columns: 1fr;
    }
    
    .gmc-add-members form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .gmc-committee-item {
        flex-direction: column;
        gap: 15px;
    }
    
    .gmc-committee-actions {
        align-self: flex-start;
    }
    
    .gmc-dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .gmc-collections-quick,
    .gmc-attendance-quick {
        flex-direction: column;
    }
    
    .gmc-event-item {
        flex-direction: column;
        text-align: center;
    }
    
    .gmc-event-date {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .gmc-dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .gmc-collections-summary-cards,
    .gmc-attendance-summary-cards {
        grid-template-columns: 1fr;
    }
    
    .gmc-stat-number {
        font-size: 28px;
    }
    
    .gmc-summary-amount {
        font-size: 24px;
    }
}

/* Print Styles for Bulletins */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-family: 'Times New Roman', serif;
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
    }
    
    .page-break {
        page-break-before: always;
    }
}

/* Animation Classes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gmc-fade-in {
    animation: fadeInUp 0.3s ease-out;
}

/* Loading States */
.gmc-loading {
    opacity: 0.6;
    pointer-events: none;
}

.gmc-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ccc;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success/Error Messages */
.gmc-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin: 15px 0;
    font-weight: 500;
}

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

.gmc-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
/* Service Order Builder Styles */
.service-order-section {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
}

.template-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.builder-instructions {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.builder-actions {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.sortable-list {
    min-height: 200px;
    border: 2px dashed #ddd;
    border-radius: 5px;
    padding: 15px;
    list-style: none;
    margin: 0;
}

.service-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.service-item:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.item-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    gap: 10px;
}

.drag-handle {
    cursor: move;
    color: #666;
    font-weight: bold;
    padding: 5px;
}

.item-title {
    flex: 1;
    border: none;
    background: transparent;
    font-weight: bold;
    padding: 5px;
}

.remove-item {
    color: #dc3545;
    font-size: 20px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 10px;
}

.item-content {
    padding: 15px;
}

.item-details {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 8px;
    resize: vertical;
    min-height: 60px;
}

.ui-sortable-helper {
    transform: rotate(2deg);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.ui-sortable-placeholder {
    background: #e7f3ff;
    border: 2px dashed #2271b1;
    margin-bottom: 10px;
    height: 80px;
    border-radius: 5px;
}

/* My Calendar Events Styling */
.mc-event-list-container {
    max-height: 300px;
    overflow-y: auto;
}

.mc-event-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mc-upcoming-event {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    margin-bottom: 5px;
}

.mc-group-1 {
    flex: 0 0 60px;
    text-align: center;
}

.mc-date-badge {
    display: inline-block;
    background: #0073aa;
    color: white;
    padding: 5px;
    border-radius: 4px;
    font-size: 0.8em;
    line-height: 1.2;
}

.mc-date-badge .month {
    display: block;
    font-weight: bold;
}

.mc-date-badge .day {
    display: block;
    font-size: 1.2em;
}

.mc-group-2 {
    flex: 1;
    padding-left: 10px;
}

.mc-group-2 a {
    font-weight: bold;
    text-decoration: none;
    color: #0073aa;
}

.mc-group-2 a:hover {
    text-decoration: underline;
}

.mc_tb, .mc_te {
    color: #666;
    font-size: 0.9em;
}