/* Secure Library Styles */

.library-container,
.shelf-container,
.resource-container {
    padding: 2.5rem 5% 4rem;
    min-height: calc(100vh - 200px);
}

/* Messages */
.messages-container {
    max-width: 800px;
    margin: 0 auto 2rem;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideDown 0.3s ease-out;
}

.alert::before {
    font-size: 1.5rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-success::before {
    content: '✓';
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-error::before {
    content: '✗';
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-warning::before {
    content: '⚠';
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.alert-info::before {
    content: 'ℹ';
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.library-header {
    text-align: center;
    margin-bottom: 3rem;
}

.library-header h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    background: linear-gradient(135deg, white 0%, white 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.2rem;
    margin-top: 0.5rem;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    /* color: #666; */
}

.breadcrumb a {
    /* color: #667eea; */
    color: wheat;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Key Entry Section */
.key-entry-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
}

.key-card,
.key-info {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.key-card h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #333;
}

.key-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: #333;
}

.key-input,
.email-input,
.form-group input,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.key-input:focus,
.email-input:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.key-input {
    font-family: 'Courier New', monospace;
    text-transform: lowercase;
    font-size: 1.2rem;
}

.form-group small {
    color: #666;
    font-size: 0.85rem;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-download,
.btn-reply {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.btn-download {
    background: #10b981;
    color: white;
}

.btn-download:hover {
    background: #059669;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-reply {
    background: transparent;
    color: #667eea;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border: 1px solid #667eea;
}

.btn-reply:hover {
    background: #667eea;
    color: white;
}

/* Shelves Grid */
.shelves-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.shelf-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.shelf-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.shelf-card.public {
    border-left: 4px solid #10b981;
}

.shelf-card.archived {
    border-left: 4px solid #f59e0b;
}

.shelf-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.shelf-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f59e0b;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.shelf-card h3 {
    margin: 0 0 1rem;
    color: #333;
}

.shelf-card p {
    color: #666;
    margin-bottom: 1rem;
}

.shelf-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #666;
}

.shelf-meta span.expires {
    color: #f59e0b;
}

.shelf-meta span.price {
    color: #10b981;
    font-weight: 600;
}

.shelf-meta span.free {
    color: #10b981;
    font-weight: 600;
}

/* Public Shelves Section */
.public-shelves-section {
    margin-bottom: 3rem;
}

.public-shelves-section h2 {
    margin-bottom: 0.5rem;
}

.public-shelves-section > p {
    color: #666;
    margin-bottom: 2rem;
}

/* Quick Links */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.link-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s;
}

.link-card:hover {
    transform: translateX(5px);
}

.link-card .icon {
    font-size: 2rem;
}

.link-card .text {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Features Section */
.features-section {
    margin-bottom: 3rem;
}

.features-section h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature h3 {
    margin: 0 0 0.5rem;
    color: #333;
}

.feature p {
    color: #666;
    margin: 0;
}

/* Shelf Detail */
.shelf-header {
    margin-bottom: 3rem;
}

.shelf-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.shelf-description {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1.5rem;
}

.shelf-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.info-badge {
    background: #f3f4f6;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.info-badge.public {
    background: #d1fae5;
    color: #065f46;
}

.info-badge.warning {
    background: #fef3c7;
    color: #92400e;
}

/* Resources Section */
.resources-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.resource-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.resource-header {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.resource-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.resource-info {
    flex: 1;
}

.resource-info h3 {
    margin: 0 0 0.5rem;
    color: #333;
}

.resource-info p {
    color: #666;
    margin: 0 0 0.75rem;
}

.resource-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: #666;
}

.resource-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Resource Detail */
.resource-detail-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.resource-icon-large {
    font-size: 5rem;
}

.resource-description {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.resource-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.text-content-box {
    line-height: 1.8;
    color: #333;
}

.image-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.link-content,
.download-section {
    text-align: center;
    padding: 2rem;
}

/* Reactions */
.reactions-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.reaction-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.reaction-btn {
    padding: 0.75rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reaction-btn:hover {
    border-color: #667eea;
    background: #f3f4f6;
}

.reaction-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.reaction-btn .count {
    font-weight: 600;
}

/* Comments Section */
.comments-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.comments-section h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.comment-form-box {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.comment-form-box h4 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment {
    border-left: 3px solid #e5e7eb;
    padding-left: 1.5rem;
}

.comment.reply {
    margin-left: 2rem;
    border-left-color: #667eea;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-date {
    color: #9ca3af;
    font-size: 0.85rem;
}

.comment-content {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.replies {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reply-form-box {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.no-comments {
    text-align: center;
    color: #9ca3af;
    padding: 2rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #9ca3af;
}

.empty-state p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

/* Info Box */
.info-box {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-top: 3rem;
}

.info-box h3 {
    margin-top: 0;
    color: #333;
}

.info-box ul {
    list-style-position: inside;
    color: #666;
    line-height: 1.8;
}

/* Request Access */
.request-access-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.shelf-info-card,
.request-form-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.shelf-info-card h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #333;
}

.access-details {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.detail-item .label {
    font-weight: 600;
    color: #666;
}

.detail-item .value {
    color: #333;
}

.detail-item .value.free {
    color: #10b981;
    font-weight: 600;
}

.detail-item .value.price {
    color: #667eea;
    font-weight: 600;
    font-size: 1.2rem;
}

.request-form-card h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.access-request-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.payment-notice,
.approval-notice {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.approval-notice {
    background: #dbeafe;
    border-left-color: #3b82f6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .library-header h1 {
        font-size: 2.5rem;
    }
    
    .key-entry-section,
    .request-access-container {
        grid-template-columns: 1fr;
    }
    
    .shelves-grid {
        grid-template-columns: 1fr;
    }
    
    .resource-header {
        flex-direction: column;
    }
    
    .comment.reply {
        margin-left: 1rem;
    }
    
    .reaction-buttons {
        flex-direction: column;
    }
    
    .shelf-info {
        flex-direction: column;
        align-items: flex-start;
    }
}
