/* Modern Agendas & Minutes Styling - Tailwind-inspired */

/* Column widths */

.agenda-minutes-documents-list th[role="columnheader"]:nth-child(5) {
    width: 9%;
}

/* Modal Styles */
.agm-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.agm-modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 0;
    border: none;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: agm-modal-slide-in 0.3s ease-out;
}

@keyframes agm-modal-slide-in {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.agm-modal-header {
    background: var(--agm-header-bg-color, linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)) !important;
    color: var(--agm-header-text-color, white) !important;
    padding: 20px 24px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.agm-modal-header h3,
.agm-modal-header .agm-modal-title {
    color: var(--agm-header-text-color, white) !important;
}

.agm-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.agm-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.agm-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.agm-modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.agm-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
}

.agm-modal-close-btn {
    background: var(--agm-header-bg-color, linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%));
    color: var(--agm-header-text-color, white);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.agm-modal-close-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Supporting Documents List */
.agm-supporting-docs-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.agm-supporting-doc-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.agm-supporting-doc-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.agm-supporting-doc-item:last-child {
    margin-bottom: 0;
}

.agm-supporting-doc-link {
    text-decoration: none;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 12px;
}

.agm-supporting-doc-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.agm-supporting-doc-info {
    flex: 1;
}

.agm-supporting-doc-name {
    font-weight: 500;
    margin: 0 0 4px 0;
    color: #1e293b;
}

.agm-supporting-doc-meta {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
}

/* Table Styles */
.agenda-minutes-documents-list {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.agenda-minutes-documents-list thead {
    background: var(--agm-header-bg-color, linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%));
}

.agenda-minutes-documents-list thead th {
    color: var(--agm-header-text-color, white);
    font-weight: 600;
    padding: 16px 12px;
    text-align: left;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.agenda-minutes-documents-list thead th strong {
    color: #FFF;
    letter-spacing: 0;
    text-transform: none;
}

.agenda-minutes-documents-list thead tr th {
    border: 0;
}

.agenda-minutes-documents-list tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.agenda-minutes-documents-list tbody tr:hover {
    background-color: #f8fafc;
}

.agenda-minutes-documents-list tbody tr:last-child {
    border-bottom: none;
}

.agenda-minutes-documents-list tbody td {
    padding: 18px 10px;
    vertical-align: top;
    font-size: 0.875rem;
    color: #374151;
    border-left: 0;
    border-right: 0;
}

.agenda-minutes-documents-list tbody tr.highlight {
    background-color: #fef3c7;
    border-left: 4px solid #f59e0b;
}

.main_color .agenda-minutes-documents-list thead tr:nth-child(odd) {
    background: transparent;
}

/* Download Links */
.agm-download-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: #eff6ff;
    border: 1px solid #dbeafe;
}

.agm-download-link:hover {
    background: #dbeafe;
    color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.agm-download-link img {
    width: 16px;
    height: 16px;
}

/* Supporting Documents Button */
.agm-supporting-docs-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.agm-supporting-docs-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Year Navigation */
.agm-year-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.agm-year-btn {
    background: white;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.875rem;
}

.agm-year-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.agm-year-btn.active {
    background: var(--agm-header-bg-color, linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)) !important;
    color: var(--agm-header-text-color, white) !important;
    border-color: var(--agm-header-bg-color, #6366f1);
}

/* Legacy year link styling for backward compatibility */
span.year-link a {
    background: #f6f6f6;
    color: #000;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
}

span.year-link a:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

span.year-link.active a {
    background: var(--agm-header-bg-color, linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)) !important;
    color: var(--agm-header-text-color, white) !important;
    border-color: var(--agm-header-bg-color, #6366f1);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .agm-modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 85vh;
    }
    
    .agm-modal-header {
        padding: 16px 20px;
    }
    
    .agm-modal-title {
        font-size: 1.125rem;
    }
    
    .agm-modal-body {
        padding: 20px;
    }
    
    .agenda-minutes-documents-list {
        font-size: 0.875rem;
        border-radius: 8px;
    }
    
    .agenda-minutes-documents-list thead th,
    .agenda-minutes-documents-list tbody td {
        padding: 12px 8px;
    }
    
    .agm-year-nav {
        padding: 12px;
        gap: 6px;
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .agm-year-btn {
        padding: 8px 16px;
        font-size: 0.875rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .agm-download-link {
        padding: 8px 12px;
        font-size: 0.875rem;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }
    
    .agm-supporting-docs-btn {
        padding: 8px 16px;
        font-size: 0.875rem;
    }
    
    /* Improve table readability on tablets */
    .agenda-minutes-documents-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 800px) {
    /* Tablet and mobile: Switch to card layout */
    .agenda-minutes-documents-list {
        display: block;
        width: 100%;
        border: none;
        box-shadow: none;
    }
    
    .agenda-minutes-documents-list thead {
        display: none;
    }
    
    .agenda-minutes-documents-list tbody {
        display: block;
    }
    
    .agenda-minutes-documents-list tr {
        display: block;
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        margin-bottom: 16px;
        padding: 16px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .agenda-minutes-documents-list tr.highlight {
        border-left: 4px solid #f59e0b;
        background: #fef3c7;
    }
    
    .agenda-minutes-documents-list td {
        display: block;
        border: none;
        padding: 8px 0;
        text-align: left;
        position: relative;
        padding-left: 0;
    }
    
    .agenda-minutes-documents-list td:before {
        content: attr(data-label);
        font-weight: 600;
        color: #374151;
        display: block;
        margin-bottom: 4px;
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    
    .agenda-minutes-documents-list td:empty {
        display: none;
    }
    
    /* Style download links better on tablet/mobile */
    .agm-download-link {
        width: 100%;
        justify-content: flex-start;
        margin: 4px 0;
    }
    
    .agm-supporting-docs-btn {
        width: 100%;
        margin: 4px 0;
    }
}

@media (min-width: 641px) and (max-width: 800px) {
    /* Two-column layout for tablets */
    .agenda-minutes-documents-list tbody {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    
    .agenda-minutes-documents-list tr {
        margin-bottom: 0;
    }
    
    /* Ensure proper spacing between columns */
    .agenda-minutes-documents-list tr:nth-child(odd) {
        margin-right: 8px;
    }
    
    .agenda-minutes-documents-list tr:nth-child(even) {
        margin-left: 8px;
    }
}

@media (max-width: 640px) {
    /* Single column layout for mobile */
    .agenda-minutes-documents-list tbody {
        display: block;
    }
    
    .agenda-minutes-documents-list tr {
        margin-bottom: 16px;
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    .agm-modal-content {
        width: 98%;
        margin: 5% auto;
        max-height: 90vh;
    }
    
    .agm-modal-header {
        padding: 12px 16px;
    }
    
    .agm-modal-title {
        font-size: 1rem;
    }
    
    .agm-modal-body {
        padding: 16px;
    }
    
    .agenda-minutes-documents-list tr {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .agenda-minutes-documents-list td {
        padding: 6px 0;
    }
    
    .agm-year-nav {
        padding: 8px;
        gap: 4px;
    }
    
    .agm-year-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}

/* Screen Reader Only Text */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

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

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

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

/* Document Status Styling 
.agm-approved-document {
    border-left: 4px solid #10b981 !important;
    background: #f0fdf4 !important;
}

.agm-draft-document {
    border-left: 4px solid #f59e0b !important;
    background: #fffbeb !important;
}

.agm-unapproved-document {
    border-left: 4px solid #ef4444 !important;
    background: #fef2f2 !important;
}

.agm-approved-document .agm-download-link {
    color: #059669;
    border-color: #10b981;
}

.agm-draft-document .agm-download-link {
    color: #d97706;
    border-color: #f59e0b;
}

.agm-unapproved-document .agm-download-link {
    color: #dc2626;
    border-color: #ef4444;
} */

span.browse-years.mobile {
    display: block;
}

.agm-year-link span.year-link:after {
    content: '';
}

.agm-year-link span.year-link a {
    margin-right: 10px;
    min-width: 88px;
    text-align: center;
    margin-bottom: 10px;
    padding: 8px 10px;
}

/* Year Selector Responsive Display */
/* Show dropdown on mobile/small screens by default */
@media screen and (max-width: 990px) {
    .agm-year-select {
        display: block !important;
        margin-bottom: 15px;
    }
    .agm-year-link {
        display: none !important;
    }
}

/* Hide dropdown on larger screens unless dropdown setting is enabled */
@media screen and (min-width: 991px) {
    .agm-year-select:not(.dropdown-enabled) {
        display: none !important;
    }
    .agm-year-link:not(.dropdown-enabled) {
        display: block !important;
		margin-bottom: 15px;
    }
}

/* Hide year links on very small screens */
@media screen and (max-width: 900px) {
    .agm-year-link {
        display: none !important;
    }
}

/* Keyboard Navigation Accessibility */
.agm-table td[tabindex="0"],
.agm-table th[tabindex="0"],
table td[tabindex="0"],
table th[tabindex="0"] {
    outline: 2px solid #3b82f6;
    outline-offset: 0px;
}

.agm-table td[tabindex="0"]:focus,
.agm-table th[tabindex="0"]:focus,
table td[tabindex="0"]:focus,
table th[tabindex="0"]:focus {
    background-color: #f0f9ff;
    border-radius: 4px;
}

/* Ensure year buttons are properly focusable */
.agm-year-link a:focus,
.agm-year-select select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}
