/**
 * SunshinePortal PDF Manager Styles
 * Version: 1.0.0
 */

/* Reset and Base Styles */
.pdf-resource-manager * {
    box-sizing: border-box;
}

.pdf-resource-manager {
    margin: 0 auto;
    padding: 20px;
}

/* Steps Progress Bar */
.steps-container {
    margin-bottom: 40px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.steps-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: top;
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.steps-wrapper::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #e8e8e8;
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e8e8e8;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.step-title {
    font-size: 14px;
    color: #666;
    text-align: center;
    transition: color 0.3s ease;
}

.step.active .step-number {
    background: #004e89;
    color: white;
}

.step.active .step-title {
    color: #004e89;
    font-weight: 600;
}

.step.completed .step-number {
    background: #011320;
    color: white;
}

.step.completed .step-number::after {
    content: '✓';
}

.step.completed .step-title {
    color: #011320;
}

/* Step Content Container */
.step-content-container {
    min-height: 500px;
}

.step-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Card Styles */
.welcome-card,
.filter-card,
.browse-card,
.upload-card {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

/* Welcome Screen */
.welcome-card h3 {
    color: #1890ff;
    margin-bottom: 20px;
    font-size: 28px;
}

.welcome-features {
    display: none;
    gap: 24px;
    margin: 30px 0;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #1890ff;
}

.feature-item .dashicons {
    font-size: 24px;
    color: #1890ff;
    margin-top: 2px;
}

.feature-item h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
}

.feature-item p {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

.welcome-instructions {
    background: #e6f7ff;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.welcome-instructions h4 {
    color: #1890ff;
    margin-top: 0;
}

.welcome-instructions ol {
    margin: 0;
    padding-left: 20px;
}

.welcome-instructions li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Buttons */
.step-button, .clear-all-filters {
    padding: 12px 24px;
    border: 1px solid #d9d9d9;
    background: #fff;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-right: 12px;
}

.step-button:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.step-button-primary {
    background: #e47135;
    color: white;
    border-color: #b9551f;
}

.step-button-primary:hover {
    background: #bf5c27;
    border-color: #b9551f;
    color: white;
}

/* Filter Styles */
.filters-container {
    margin: 30px 0;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}



/* Admin Panel Styles */
.admin-toggle {
    background: #e47135;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 900;
    transition: background-color 0.2s ease;
}

.admin-toggle:hover {
    background: #b25522;
}

.admin-panel {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.admin-panel h3 {
    margin: 0 0 20px 0;
    color: #333;
}

.admin-form {
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;

}

.form-group label {
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: #007cba;
}

.upload-pdf-btn {
    background: #f0f8ff;
    border: 2px solid #004e89;
    color: #004e89;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.upload-pdf-btn:hover {
    background: #00335a;
    color: white;
}

.add-pdf-btn {
    background: #004e89;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    grid-column: 1 / -1;
    transition: background-color 0.2s ease;
}

.add-pdf-btn:hover {
    background: #00335a;
}

#pdfPreview {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 13px;
}

.pdf-action-btn {
    background: #004e89;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
    margin-top: 10px;
    font-weight: bold;
}
/* Filters Container */
.filters-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.filter-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    position: relative;
    min-width: 180px;
}

/* Single Selection Filter Styles */
.filter-dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
}

.dropdown-button {
    width: 100%;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.2s;
}

.dropdown-button:hover {
    border-color: #999;
}

.dropdown-button.active {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

/* Label styling for selected state */
.dropdown-button.has-selection {
    background-color: #f0f8ff;
    border-color: #007cba;
    color: #007cba;
    font-weight: 500;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.dropdown-content.show {
    display: block;
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    font-weight: 500;
}

.clear-filter {
    color: #dc3545;
    text-decoration: none;
    font-size: 12px;
}

.clear-filter:hover {
    text-decoration: underline;
}

.filter-options {
    max-height: 150px;
    overflow-y: auto;
}

.filter-option {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.filter-option:hover {
    background-color: #f8f9fa;
}

/* IMPORTANT: Single selection styling */
.filter-option.selected {
    background-color: #007cba !important;
    color: white !important;
    font-weight: 500;
}

.filter-option.selected:hover {
    background-color: #005a87 !important;
}

/* Ensure only one option can appear selected */
.filter-options .filter-option.selected ~ .filter-option.selected {
    background-color: #f8f9fa !important;
    color: #333 !important;
    font-weight: normal !important;
}

/* Applied filters styling */
.applied-filters {
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.filter-tag {
    display: inline-block;
    background: #004e89;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    margin: 2px 4px 12px 0;
    font-size: 12px;
    font-weight: bold;
}

.filter-tag .remove-tag {
    margin-left: 5px;
    cursor: pointer;
    font-weight: bold;
}

.filter-tag .remove-tag:hover {
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
}

/* Prevent text selection on filter elements */
.dropdown-button,
.filter-option {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}


.filter-option:hover {
    background: #f0f8ff;
}

.filter-option input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 20px;
}

.filter-option label {
    cursor: pointer;
    user-select: none;
}


/* Search Container */
.search-container {
    margin-bottom: 20px;
}

.search-container input [type="text"]{
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #007cba;
}

/* Results Container */
.results-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
}

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

.results-count {
    font-weight: 600;
    color: #333;
}

.sort-dropdown {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.sort-dropdown:focus {
    outline: none;
    border-color: #007cba;
}

/* PDF Grid */
.pdf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 25px;
}

.pdf-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s ease;
    background: white;
}



.pdf-icon {
    width: 48px;
    height: 48px;
    background: #dc3545;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 14px;
}

.pdf-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    line-height: 1.3;
}

.pdf-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.pdf-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.pdf-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
}

.download-btn {
    background: #004e89;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
    transition: background 0.2s ease;
}

.download-btn:hover {
    background: #00335a;
}

.download-btn:active {
    transform: translateY(1px);
}

/* No Results and Loading States */
.no-results, .loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
    grid-column: 1 / -1;
}

.no-results.error {
    color: #dc3545;
}

.loading {
    color: #007cba;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pdf-resource-manager {
        padding: 15px;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        min-width: 100%;
    }

    .dropdown-button {
        min-width: 100%;
    }

    .pdf-grid {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 15px;
    }

    .results-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .admin-form {
        grid-template-columns: 1fr;
    }
    
    .filters-container {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .pdf-resource-manager {
        padding: 10px;
    }
    
    .filters-container,
    .admin-panel {
        padding: 15px;
    }
    
    .pdf-grid {
        padding: 15px;
    }
    
    .pdf-card {
        padding: 15px;
    }
}


.instruction-step {
    margin: 16px 0;
    border-bottom: 1px solid #e5e5e5;
    padding: 10px 0;
}