/**
 * AKOKVO Custom Plugin Styles v1.3.1
 * Compact layout with quick access buttons
 */

:root {
    --akokvo-primary: #e42e57;
    --akokvo-primary-dark: #c21943;
    --akokvo-primary-light: #ffe7ee;
    --akokvo-secondary: #2c3e50;
    --akokvo-text: #333333;
    --akokvo-text-light: #666666;
    --akokvo-border: #dddddd;
    --akokvo-bg-light: #f8f9fa;
    --akokvo-bg-gray: #f5f5f5;
    --akokvo-white: #ffffff;
    --akokvo-success: #28a745;
    --akokvo-warning: #ffc107;
}

/* Main Wrapper */
.akokvo-registrar-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header */
.akokvo-registrar-header {
    text-align: center;
    margin-bottom: 30px;
}

.akokvo-page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--akokvo-secondary);
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.akokvo-page-info {
    background: var(--akokvo-primary-light);
    border-left: 4px solid var(--akokvo-primary);
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 25px;
}

.akokvo-info-text {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 15px;
    color: var(--akokvo-secondary);
}

.akokvo-info-text .dashicons {
    color: var(--akokvo-primary);
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Quick Access Cards */
.akokvo-quick-access {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.akokvo-access-card {
    background: var(--akokvo-white);
    border: 2px solid var(--akokvo-border);
    border-radius: 10px;
    padding: 18px 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.3s ease;
    min-height: 170px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.akokvo-access-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.akokvo-card-all {
    border-color: var(--akokvo-primary);
}

.akokvo-card-valid {
    border-color: var(--akokvo-success);
}

.akokvo-card-english {
    border-color: var(--akokvo-primary);
    background: var(--akokvo-primary-light);
}

.akokvo-card-icon {
    font-size: 28px;
    text-align: center;
    line-height: 1;
}

.akokvo-card-content {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 5px 0;
}

.akokvo-card-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--akokvo-primary);
    line-height: 1;
}

.akokvo-card-label {
    font-size: 11px;
    color: var(--akokvo-text-light);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.akokvo-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--akokvo-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.2;
}

.akokvo-card-breakdown {
    font-size: 10px;
    color: var(--akokvo-text-light);
    margin-top: 4px;
    line-height: 1.3;
}

.akokvo-card-breakdown span {
    font-weight: 700;
    color: var(--akokvo-primary);
    font-size: 11px;
}

.akokvo-card-btn {
    background: var(--akokvo-primary);
    color: var(--akokvo-white);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
    width: 100%;
}

.akokvo-card-btn:hover {
    background: var(--akokvo-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(228, 46, 87, 0.3);
}

.akokvo-card-btn-primary {
    font-size: 15px;
    padding: 11px 20px;
}

/* Compact Search Bar */
.akokvo-search-compact {
    margin-bottom: 20px;
}

.akokvo-search-input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid var(--akokvo-border);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.akokvo-search-input:focus {
    outline: none;
    border-color: var(--akokvo-primary);
    box-shadow: 0 0 0 3px var(--akokvo-primary-light);
}

.akokvo-search-input::placeholder {
    color: var(--akokvo-text-light);
}

/* Compact Filters */
.akokvo-filters-compact {
    background: var(--akokvo-white);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.akokvo-section-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--akokvo-secondary);
    margin: 0 0 15px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--akokvo-bg-light);
}

.akokvo-section-heading .dashicons {
    color: var(--akokvo-primary);
}

.akokvo-filters-main-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.akokvo-filter-item label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--akokvo-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.akokvo-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--akokvo-border);
    border-radius: 6px;
    font-size: 14px;
}

.akokvo-select:focus {
    outline: none;
    border-color: var(--akokvo-primary);
}

/* Checkboxes */
.akokvo-filters-checks {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 12px 0;
}

.akokvo-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.akokvo-check-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Additional Filters Toggle */
.akokvo-additional-toggle {
    padding: 10px 0;
}

.akokvo-toggle-btn {
    background: transparent;
    border: none;
    color: var(--akokvo-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.akokvo-toggle-btn:hover {
    text-decoration: underline;
}

.akokvo-additional-filters {
    padding: 15px 0;
}

.akokvo-filters-additional-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.akokvo-date-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.akokvo-date-group input[type="date"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--akokvo-border);
    border-radius: 6px;
}

/* Action Buttons */
.akokvo-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--akokvo-bg-light);
}

.akokvo-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.akokvo-btn-primary {
    background: var(--akokvo-primary);
    color: var(--akokvo-white);
}

.akokvo-btn-primary:hover {
    background: var(--akokvo-primary-dark);
}

.akokvo-btn-secondary {
    background: var(--akokvo-white);
    color: var(--akokvo-secondary);
    border: 2px solid var(--akokvo-border);
}

.akokvo-btn-secondary:hover {
    border-color: var(--akokvo-primary);
    color: var(--akokvo-primary);
}

/* Initial Message (compact) */
.akokvo-initial-message {
    padding: 20px;
    max-width: 450px;
    margin: 20px auto;
    background: var(--akokvo-white);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.akokvo-message-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.akokvo-message-icon-inline {
    font-size: 24px !important;
    width: 24px !important;
    height: 24px !important;
    color: var(--akokvo-primary);
    flex-shrink: 0;
}

.akokvo-initial-message p {
    color: var(--akokvo-text-light);
    font-size: 14px;
    margin: 0;
}

/* Results Info */
.akokvo-results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--akokvo-bg-light);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.akokvo-results-summary {
    font-size: 15px;
    font-weight: 600;
    color: var(--akokvo-secondary);
}

.akokvo-results-badges {
    display: flex;
    gap: 12px;
}

.akokvo-badge {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.akokvo-badge-pink {
    background: var(--akokvo-primary-light);
    color: var(--akokvo-primary);
}

.akokvo-badge-gray {
    background: var(--akokvo-bg-gray);
    color: var(--akokvo-text);
}

/* Export Section */
.akokvo-export-section {
    display: flex;
    justify-content: flex-end;
    padding: 8px 0;
    margin-bottom: 15px;
}

.akokvo-export-buttons {
    display: flex;
    gap: 8px;
}

.akokvo-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Programs Sections */
.akokvo-programs-section {
    margin-bottom: 30px;
}

.akokvo-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.akokvo-status-badge {
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 600;
    color: var(--akokvo-white);
}

.akokvo-badge-akreditacija {
    background: var(--akokvo-primary);
}

.akokvo-badge-reakreditacija {
    background: #6c757d;
}

.akokvo-count {
    background: var(--akokvo-bg-light);
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 13px;
}

.akokvo-compact-table-wrapper {
    background: var(--akokvo-white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.akokvo-compact-table {
    width: 100%;
    border-collapse: collapse;
}

.akokvo-compact-table thead {
    background: var(--akokvo-secondary);
    color: var(--akokvo-white);
}

.akokvo-compact-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
}

.akokvo-compact-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--akokvo-border);
    font-size: 13px;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Compact column widths for 9-column layout */
.akokvo-compact-table th:nth-child(1),
.akokvo-compact-table td:nth-child(1) {
    width: 50px;
    text-align: center;
}

.akokvo-compact-table th:nth-child(2),
.akokvo-compact-table td:nth-child(2) {
    width: 22%;
    max-width: 200px;
}

.akokvo-compact-table th:nth-child(3),
.akokvo-compact-table td:nth-child(3) {
    width: 18%;
    max-width: 180px;
}

.akokvo-compact-table th:nth-child(4),
.akokvo-compact-table td:nth-child(4) {
    width: 15%;
    max-width: 150px;
}

/* Važeći prog. - nova uska kolona */
.akokvo-compact-table th:nth-child(5),
.akokvo-compact-table td:nth-child(5) {
    width: 4%;
    max-width: 50px;
    text-align: center;
}

.akokvo-compact-table th:nth-child(6),
.akokvo-compact-table td:nth-child(6) {
    width: 12%;
    max-width: 120px;
}

.akokvo-compact-table th:nth-child(7),
.akokvo-compact-table td:nth-child(7) {
    width: 10%;
    max-width: 100px;
}

.akokvo-compact-table th:nth-child(8),
.akokvo-compact-table td:nth-child(8) {
    width: 10%;
    max-width: 100px;
    text-align: center;
}

.akokvo-compact-table th:nth-child(9),
.akokvo-compact-table td:nth-child(9) {
    width: 90px;
    text-align: center;
}

/* Zebra striping for better readability */
.akokvo-akreditacija-section tbody tr:nth-child(4n+1),
.akokvo-akreditacija-section tbody tr:nth-child(4n+2) {
    background-color: #fef5f8; /* Lighter pink */
}

.akokvo-akreditacija-section tbody tr:nth-child(4n+3),
.akokvo-akreditacija-section tbody tr:nth-child(4n+4) {
    background-color: #fcecf1; /* Slightly darker pink */
}

.akokvo-reakreditacija-section tbody tr:nth-child(4n+1),
.akokvo-reakreditacija-section tbody tr:nth-child(4n+2) {
    background-color: #f8f9fa; /* Lighter gray */
}

.akokvo-reakreditacija-section tbody tr:nth-child(4n+3),
.akokvo-reakreditacija-section tbody tr:nth-child(4n+4) {
    background-color: #f0f1f3; /* Slightly darker gray */
}

.akokvo-compact-table tbody tr:hover {
    background-color: rgba(228, 46, 87, 0.15) !important;
}

.akokvo-action-col {
    text-align: center;
    width: 90px;
}

/* Institution group headers */
.akokvo-institution-header {
    background: linear-gradient(90deg, #e42e57 0%, #c02347 100%) !important;
}

.akokvo-institution-header td {
    color: white !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    padding: 12px 15px !important;
    border-bottom: 3px solid #a01d3a !important;
    text-align: left !important;
}

.akokvo-institution-header:hover {
    background: linear-gradient(90deg, #e42e57 0%, #c02347 100%) !important;
}

.akokvo-btn-expand, .akokvo-btn-collapse {
    padding: 5px 12px;
    font-size: 12px;
}

/* Expanded Details */
.akokvo-expanded-details {
    background: var(--akokvo-white);
    padding: 18px;
    border-left: 4px solid var(--akokvo-primary);
}

.akokvo-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.akokvo-detail-item {
    padding: 8px 0;
}

.akokvo-detail-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--akokvo-text-light);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.akokvo-detail-value {
    font-size: 14px;
    color: var(--akokvo-text);
}

.akokvo-doc-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--akokvo-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.akokvo-doc-link:hover {
    color: var(--akokvo-secondary);
    text-decoration: underline;
}

.akokvo-doc-link .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.akokvo-doc-no-link {
    color: var(--akokvo-text-light);
    font-style: italic;
}

/* Pagination */
.akokvo-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 18px;
}

.akokvo-page-btn {
    padding: 6px 12px;
    border: 1px solid var(--akokvo-border);
    background: var(--akokvo-white);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.akokvo-page-btn:hover {
    background: var(--akokvo-primary);
    color: var(--akokvo-white);
    border-color: var(--akokvo-primary);
}

.akokvo-page-btn.active {
    background: var(--akokvo-primary);
    color: var(--akokvo-white);
    border-color: var(--akokvo-primary);
}

/* Loading & Empty States */
.akokvo-loading-state {
    text-align: center;
    padding: 50px 20px;
}

.akokvo-spinner {
    width: 45px;
    height: 45px;
    border: 4px solid var(--akokvo-bg-light);
    border-top-color: var(--akokvo-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 18px;
}

.akokvo-no-results {
    text-align: center;
    padding: 50px 20px;
    background: var(--akokvo-white);
    border-radius: 10px;
}

.akokvo-empty-icon .dashicons {
    font-size: 70px;
    color: var(--akokvo-border);
}

/* Status Badges */
.akokvo-status-valid {
    color: var(--akokvo-success);
    font-weight: 600;
}

.akokvo-status-expired {
    color: var(--akokvo-warning);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .akokvo-registrar-wrapper {
        padding: 20px 12px;
    }
    
    .akokvo-page-title {
        font-size: 24px;
    }
    
    .akokvo-quick-access {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .akokvo-filters-main-row {
        grid-template-columns: 1fr;
    }
    
    .akokvo-filters-checks {
        flex-direction: column;
    }
    
    .akokvo-filter-actions {
        flex-direction: column;
    }
    
    .akokvo-results-info {
        flex-direction: column;
        gap: 12px;
    }
    
    .akokvo-compact-table {
        font-size: 12px;
    }
    
    .akokvo-compact-table th,
    .akokvo-compact-table td {
        padding: 8px 6px;
    }

    /* Horizontal scroll for table on mobile */
    .akokvo-compact-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .akokvo-compact-table {
        min-width: 800px;
    }

    /* Stack search inputs vertically on mobile */
    .akokvo-search-compact {
        flex-direction: column !important;
        gap: 10px !important;
    }
}

/* Mobile Landscape Notice */
.akokvo-mobile-notice {
    display: none; /* Hidden by default */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.akokvo-mobile-notice-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.akokvo-mobile-notice .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: white;
    animation: rotate-phone 2s ease-in-out infinite;
}

.akokvo-mobile-notice p {
    margin: 5px 0;
    font-size: 16px;
    line-height: 1.5;
}

.akokvo-mobile-notice strong {
    font-size: 18px;
    display: block;
    margin-bottom: 5px;
}

@keyframes rotate-phone {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-15deg);
    }
    75% {
        transform: rotate(15deg);
    }
}

/* Show notice only on mobile portrait mode */
@media (max-width: 768px) and (orientation: portrait) {
    .akokvo-mobile-notice {
        display: block;
    }
}

/* Hide notice in landscape mode or desktop */
@media (min-width: 769px), (orientation: landscape) {
    .akokvo-mobile-notice {
        display: none !important;
    }
}

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
