/**
 * TCP Document Library - Public Styles
 */

/* Container */
.tcp-documents-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Loading State */
.tcp-loading {
    text-align: center;
    padding: 60px 20px;
}

.tcp-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: tcp-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes tcp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Login Required */
.tcp-login-required {
    text-align: center;
    padding: 60px 20px;
}

.tcp-login-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 40px;
    max-width: 400px;
    margin: 0 auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tcp-login-button {
    display: inline-block;
    background: #2271b1;
    color: #fff;
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.tcp-login-button:hover {
    background: #135e96;
    color: #fff;
}

/* Search and Filters */
.tcp-search-filters {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tcp-search-box {
    margin-bottom: 15px;
}

.tcp-search-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.tcp-search-input:focus {
    outline: none;
    border-color: #2271b1;
}

.tcp-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tcp-filter-select {
    flex: 1;
    min-width: 150px;
    padding: 10px 12px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.tcp-filter-select:focus {
    outline: none;
    border-color: #2271b1;
}

.tcp-clear-filters {
    padding: 10px 16px;
    background: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.tcp-clear-filters:hover {
    background: #e0e0e0;
}

/* Results Info */
.tcp-results-info {
    padding: 15px 20px;
    background: #f7f7f7;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Documents Grid */
.tcp-documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Document Card */
.tcp-document-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tcp-document-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.tcp-document-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #1a1a1a;
    line-height: 1.4;
}

.tcp-document-description {
    font-size: 14px;
    color: #666;
    margin: 0 0 15px 0;
    line-height: 1.5;
}

.tcp-document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tcp-meta-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 12px;
    font-weight: 600;
}

.tcp-meta-badge.category {
    background: #e7f3ff;
    color: #0066cc;
}

.tcp-meta-badge.brand {
    background: #fff3e0;
    color: #e65100;
}

.tcp-meta-badge.product-system {
    background: #e8f5e9;
    color: #2e7d32;
}

.tcp-meta-badge.type {
    background: #f3e5f5;
    color: #7b1fa2;
}

.tcp-view-button {
    display: inline-block;
    width: 100%;
    padding: 10px 16px;
    background: #2271b1;
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

.tcp-view-button:hover {
    background: #135e96;
    color: #fff;
}

/* Empty State */
.tcp-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.tcp-empty-icon {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 20px;
}

.tcp-empty-message {
    font-size: 18px;
    color: #666;
    margin: 0;
}

/* Error State */
.tcp-error-state {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    color: #c00;
}

/* Pagination */
.tcp-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px 20px;
    flex-wrap: wrap;
}

.tcp-page-button {
    padding: 8px 16px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.tcp-page-button:hover:not(:disabled) {
    background: #135e96;
}

.tcp-page-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.tcp-page-numbers {
    display: flex;
    align-items: center;
    gap: 5px;
}

.tcp-page-number {
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    background: #fff;
    color: #2271b1;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.tcp-page-number:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.tcp-page-number.active {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.tcp-page-ellipsis {
    padding: 8px 4px;
    color: #666;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .tcp-documents-wrapper {
        padding: 15px;
    }

    .tcp-documents-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .tcp-filters {
        flex-direction: column;
    }

    .tcp-filter-select {
        width: 100%;
    }

    .tcp-results-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .tcp-pagination {
        gap: 5px;
        padding: 20px 10px;
    }

    .tcp-page-button {
        padding: 6px 12px;
        font-size: 13px;
    }

    .tcp-page-number {
        min-width: 36px;
        height: 36px;
        padding: 6px 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .tcp-document-card {
        padding: 15px;
    }

    .tcp-document-title {
        font-size: 16px;
    }

    .tcp-search-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}
