/**
 * Frontend Styles for Circulars Management Plugin
 */

/* Container Styles */
.cm-frontend-container {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Search Styles */
.cm-search-container {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.cm-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cm-search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.cm-search-button {
    padding: 10px 20px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.cm-search-button:hover {
    background: #005a87;
}

.cm-clear-search,
.cm-clear-search-link {
    padding: 8px 15px;
    background: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    transition: background-color 0.3s ease;
}

.cm-clear-search:hover,
.cm-clear-search-link:hover {
    background: #545b62;
    color: white;
    text-decoration: none;
}

/* Table Layout Styles */
.cm-table-layout .cm-table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.cm-circulars-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.cm-circulars-table th,
.cm-circulars-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.cm-circulars-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.cm-circulars-table tbody tr:hover {
    background: #f8f9fa;
}

.cm-circulars-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.cm-circulars-table tbody tr:nth-child(even):hover {
    background: #f0f0f0;
}

/* Table Column Widths */
.cm-col-date {
    width: 120px;
    white-space: nowrap;
}

.cm-col-title {
    width: auto;
    min-width: 200px;
}

.cm-col-category {
    width: 150px;
}

.cm-col-action {
    width: 120px;
    text-align: center;
}

/* Title and Description */
.cm-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.cm-description {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* Category Badge */
.cm-category-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Action Buttons */
.cm-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.cm-action-btn:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

.cm-download-btn {
    background: #28a745;
}

.cm-download-btn:hover {
    background: #218838;
}

.cm-view-btn {
    background: #17a2b8;
}

.cm-view-btn:hover {
    background: #138496;
}

.cm-image-btn {
    background: #28a745;
}

.cm-image-btn:hover {
    background: #218838;
}

/* Download Statistics */
.cm-col-downloads {
    width: 100px;
    text-align: center;
}

.cm-download-count {
    font-weight: bold;
    color: #0073aa;
    font-size: 16px;
}

.cm-btn-icon {
    font-size: 16px;
}

/* Card Layout Styles */
.cm-card-layout .cm-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.cm-circular-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.cm-circular-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.cm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.cm-card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    flex: 1;
}

.cm-card-date {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
}

.cm-card-description {
    margin-bottom: 15px;
    color: #666;
    line-height: 1.5;
    font-size: 14px;
}

.cm-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.cm-card-category {
    display: inline-block;
    padding: 4px 8px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Pagination Styles */
.cm-pagination-top,
.cm-pagination-bottom {
    margin: 20px 0;
    text-align: center;
}

.cm-frontend-pagination {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.cm-pagination-link,
.cm-pagination-current {
    display: inline-block;
    padding: 8px 12px;
    text-decoration: none;
    border: 1px solid #ddd;
    color: #0073aa;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.cm-pagination-link:hover {
    background: #f0f0f0;
    color: #005a87;
    text-decoration: none;
}

.cm-pagination-current {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
    font-weight: 600;
}

.cm-pagination-dots {
    padding: 8px 4px;
    color: #666;
    border: none;
}

.cm-prev-link,
.cm-next-link {
    font-weight: 500;
}

/* No Circulars Message */
.cm-no-circulars {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #666;
}

.cm-no-circulars p {
    margin: 0;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cm-search-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cm-search-input {
        min-width: auto;
        margin-bottom: 10px;
    }
    
    .cm-table-wrapper {
        margin: 10px 0;
    }
    
    .cm-circulars-table th,
    .cm-circulars-table td {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .cm-col-date,
    .cm-col-category,
    .cm-col-downloads {
        display: none;
    }
    
    .cm-col-action {
        width: 100px;
    }
    
    .cm-action-btn {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .cm-btn-text {
        display: none;
    }
    
    .cm-cards-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .cm-circular-card {
        padding: 15px;
    }
    
    .cm-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .cm-card-date {
        align-self: flex-end;
    }
    
    .cm-card-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .cm-frontend-pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .cm-pagination-link,
    .cm-pagination-current {
        padding: 6px 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .cm-frontend-container {
        margin: 10px 0;
    }
    
    .cm-circulars-table th,
    .cm-circulars-table td {
        padding: 6px 8px;
        font-size: 13px;
    }
    
    .cm-title {
        font-size: 14px;
    }
    
    .cm-description {
        font-size: 12px;
    }
    
    .cm-card-title {
        font-size: 16px;
    }
    
    .cm-card-description {
        font-size: 13px;
    }
}

/* Print Styles */
@media print {
    .cm-action-btn,
    .cm-pagination-top,
    .cm-pagination-bottom {
        display: none !important;
    }
    
    .cm-circular-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .cm-circulars-table {
        border: 1px solid #000;
    }
    
    .cm-circulars-table th,
    .cm-circulars-table td {
        border: 1px solid #000;
    }
}