/* Subscription Browse Styles */

.subscription-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.subscription-header {
    margin-bottom: 30px;
}

.subscription-header .header-top {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

.subscription-header h1 {
    margin: 0;
    font-size: 2em;
    color: #2c3e50;
}

.subscription-header .header-description {
    color: #7f8c8d;
    margin: 0;
    font-size: 1.1em;
}

.back-btn {
    padding: 8px 16px;
    background: #ecf0f1;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    color: #34495e;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #bdc3c7;
}

/* Tabs */
.subscription-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #ecf0f1;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1.1em;
    color: #7f8c8d;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: #34495e;
}

.tab-btn.active {
    color: #f7931a;
    border-bottom-color: #f7931a;
}

.tab-btn .badge {
    background: #f7931a;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    min-width: 20px;
    text-align: center;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Search Section */
.search-section {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.search-bar-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    transition: border-color 0.3s ease;
}

.search-bar-container:focus-within {
    border-color: #f7931a;
}

.search-icon {
    font-size: 1.2em;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1em;
    color: #2c3e50;
}

.clear-search {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    color: #95a5a6;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.clear-search:hover {
    color: #e74c3c;
}

.search-btn {
    padding: 12px 32px;
    background: #f7931a;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: #e88909;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(247, 147, 26, 0.3);
}

/* Authors Grid */
.authors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.author-card {
    background: white;
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.author-card:hover {
    border-color: #f7931a;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.author-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f7931a, #e88909);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    color: white;
}

.author-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.3em;
    color: #2c3e50;
}

.author-stats {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
    color: #7f8c8d;
}

.author-bio {
    color: #34495e;
    margin: 15px 0;
    line-height: 1.5;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.author-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.subscribe-btn {
    padding: 10px 20px;
    background: #f7931a;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.subscribe-btn:hover {
    background: #e88909;
}

.subscribe-btn.subscribed {
    background: #27ae60;
}

.subscribe-btn.subscribed:hover {
    background: #229954;
}

.view-details-btn {
    padding: 10px 20px;
    background: #ecf0f1;
    color: #34495e;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.view-details-btn:hover {
    background: #bdc3c7;
}

/* Subscriptions Grid */
.subscriptions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.subscription-card {
    background: white;
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.subscription-card:hover {
    border-color: #27ae60;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.subscription-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.subscription-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.3em;
    color: #2c3e50;
}

.subscription-date {
    font-size: 0.9em;
    color: #7f8c8d;
}

.subscription-status {
    padding: 6px 12px;
    background: #27ae60;
    color: white;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.subscription-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 15px 0;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.8em;
    font-weight: 700;
    color: #f7931a;
}

.stat-label {
    font-size: 0.9em;
    color: #7f8c8d;
}

.subscription-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.unsubscribe-btn {
    flex: 1;
    padding: 10px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.unsubscribe-btn:hover {
    background: #c0392b;
}

.check-books-btn {
    flex: 1;
    padding: 10px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.check-books-btn:hover {
    background: #2980b9;
}

/* Pending Books */
.pending-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #e8f8f5;
    border-radius: 12px;
}

.pending-info {
    margin: 0;
    color: #27ae60;
    font-weight: 600;
}

.pending-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.pending-book-card {
    background: white;
    border: 2px solid #3498db;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.pending-book-card:hover {
    border-color: #2980b9;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.pending-book-header {
    margin-bottom: 15px;
}

.pending-book-title {
    font-size: 1.3em;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 10px 0;
}

.pending-book-author {
    color: #7f8c8d;
    margin: 0;
}

.pending-book-meta {
    display: flex;
    gap: 15px;
    margin: 15px 0;
    font-size: 0.9em;
    color: #95a5a6;
}

.download-book-btn {
    width: 100%;
    padding: 12px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s ease;
}

.download-book-btn:hover {
    background: #229954;
}

.download-book-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #ecf0f1;
    border-top-color: #f7931a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

.empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.8em;
    color: #2c3e50;
    margin: 0 0 10px 0;
}

.empty-state p {
    color: #7f8c8d;
    font-size: 1.1em;
    margin: 0 0 20px 0;
}

.primary-btn {
    padding: 12px 32px;
    background: #f7931a;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.primary-btn:hover {
    background: #e88909;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(247, 147, 26, 0.3);
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #2c3e50;
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
    max-width: 400px;
}

.notification-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.notification-toast.success {
    background: #27ae60;
}

.notification-toast.error {
    background: #e74c3c;
}

.notification-toast.info {
    background: #3498db;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #95a5a6;
    transition: color 0.3s ease;
    z-index: 1;
}

.modal-close:hover {
    color: #e74c3c;
}

/* Author Books Browser */
.author-books-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.author-books-header h2 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 1.8em;
}

.author-books-header p {
    margin: 0;
    color: #7f8c8d;
    font-size: 1.1em;
}

.author-books-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.book-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: white;
}

.book-card.available {
    border-color: #27ae60;
    background: #f0fff4;
}

.book-card.owned {
    border-color: #95a5a6;
    background: #f8f9fa;
    opacity: 0.8;
}

.book-card.out-of-stock {
    border-color: #e74c3c;
    background: #fff5f5;
    opacity: 0.7;
}

.book-info {
    flex: 1;
    min-width: 0;
}

.book-title {
    margin: 0 0 8px 0;
    font-size: 1.2em;
    color: #2c3e50;
    word-wrap: break-word;
}

.book-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.9em;
    color: #7f8c8d;
}

.book-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.book-action {
    margin-left: 15px;
}

.book-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.book-btn.available {
    background: #27ae60;
    color: white;
}

.book-btn.available:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
}

.book-btn.owned {
    background: #95a5a6;
    color: white;
    cursor: default;
}

.book-btn.out-of-stock {
    background: #e74c3c;
    color: white;
    cursor: default;
    opacity: 0.6;
}

.book-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.browse-books-btn {
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
}

.browse-books-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .subscription-container {
        padding: 10px;
    }

    .subscription-header .header-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .subscription-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        flex-shrink: 0;
    }

    .search-section {
        flex-direction: column;
    }

    .authors-grid,
    .subscriptions-grid,
    .pending-books-grid {
        grid-template-columns: 1fr;
    }

    .pending-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .notification-toast {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }
    
    .reader-id-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Reader ID Footer */
.reader-id-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 900;
    font-size: 14px;
}

.reader-id-label {
    font-weight: 600;
    opacity: 0.9;
}

.reader-id-value {
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    letter-spacing: 0.5px;
    user-select: all;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.copy-btn:active {
    transform: scale(0.95);
}

/* Add padding to content to prevent footer overlap */
.subscription-container {
    padding-bottom: 80px;
}
