/* Collection Manager Styles */

.collection-manager-content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.manager-section {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.manager-section h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
}

.manager-section h4 {
    margin-top: 0;
    color: #666;
}

/* Collection Switcher Styles */
.collection-switcher {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.collection-switcher label {
    font-weight: bold;
    color: white;
    margin-right: 8px;
}

.collection-switcher select {
    min-width: 250px;
}

/* Collections List */
.collections-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.collection-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    transition: border-color 0.3s;
}

.collection-item:hover {
    border-color: #4CAF50;
}

.collection-item.active {
    border-color: #4CAF50;
    background: #f0f8ff;
}

.collection-item.active .collection-info h4 {
    color: #4CAF50;
}

.collection-info h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.collection-info p {
    margin: 5px 0;
    font-size: 13px;
    color: #666;
}

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

/* Forms */
.form-group {
    margin-bottom: 15px;
}

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

.form-group input, .form-group select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Card Selection Interface */
.card-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.selection-controls {
    display: flex;
    gap: 10px;
}

.target-collection {
    display: flex;
    align-items: center;
}

.target-collection label {
    font-weight: bold;
    color: #333;
}

.search-filter {
    margin-bottom: 15px;
}

.search-filter input {
    width: 100%;
    max-width: 300px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Cards List */
.cards-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background: white;
}

.card-checkbox-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.card-checkbox-item:hover {
    background-color: #f5f5f5;
}

.card-checkbox-item:last-child {
    border-bottom: none;
}

.card-checkbox-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    gap: 12px;
}

.card-checkbox-item input[type="checkbox"] {
    flex-shrink: 0;
}

.card-image {
    flex-shrink: 0;
    width: 50px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #f9f9f9;
}

.card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 3px;
}

.card-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 4px;
    min-width: 0; /* Allow text to wrap/truncate */
}

.card-name {
    font-weight: bold;
    color: #333;
    word-wrap: break-word;
    line-height: 1.3;
}

.card-console {
    color: #666;
    font-size: 12px;
}

.card-price {
    color: #4CAF50;
    font-weight: bold;
    font-size: 13px;
}

/* Collection Cards Management */
.collection-cards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.collection-search {
    margin-bottom: 15px;
}

.collection-search input {
    width: 100%;
    max-width: 300px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Button Styles */
.action-button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.action-button:hover {
    background: #45a049;
}

.action-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.action-button.small {
    padding: 5px 10px;
    font-size: 12px;
}

.action-button.reset-button {
    background: #f44336;
}

.action-button.reset-button:hover {
    background: #d32f2f;
}

/* Authentication styles (inherited from refresh-cards) */
.auth-section {
    background: #fff;
    border: 2px solid #ddd;
    margin-bottom: 20px;
}

.auth-section h3 {
    border-bottom: 2px solid #FFA500;
}

.auth-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.auth-status {
    font-weight: bold;
    padding: 5px 0;
}

.auth-status.success {
    color: #4CAF50;
}

.auth-status.error {
    color: #f44336;
}

/* Fetch Status Styles */
.fetch-status {
    font-weight: bold;
    padding: 8px 0;
    font-size: 14px;
}

.fetch-status.loading {
    color: #2196F3;
}

.fetch-status.success {
    color: #4CAF50;
}

.fetch-status.warning {
    color: #FF9800;
}

.fetch-status.error {
    color: #f44336;
}

/* Image Preview Styles for Collection Manager */
.image-preview {
    position: absolute;
    background: white;
    border: 2px solid #ddd;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 10000;
    max-width: 300px;
    padding: 0;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.8);
    animation: previewFadeIn 0.2s ease-out forwards;
}

.image-preview .preview-image {
    width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: contain;
    display: block;
    border-radius: 13px 13px 0 0;
}

.image-preview .preview-title {
    padding: 12px 15px;
    background: #f8f9fa;
    font-weight: bold;
    font-size: 0.9rem;
    color: #333;
    text-align: center;
    border-radius: 0 0 13px 13px;
    line-height: 1.3;
    word-wrap: break-word;
}

@keyframes previewFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Add hover cursor to card images */
.card-image img {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.card-image img:hover {
    opacity: 0.8;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        text-align: center;
    }

    .header-left {
        text-align: center;
    }

    .header-right {
        justify-content: center;
    }

    .collection-switcher {
        justify-content: center;
    }

    .collection-switcher select {
        min-width: 200px;
    }

    .collections-list {
        grid-template-columns: 1fr;
    }

    .card-selection-header {
        flex-direction: column;
        align-items: stretch;
    }

    .selection-controls {
        justify-content: center;
    }

    .target-collection {
        justify-content: center;
    }

    .collection-cards-header {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions {
        justify-content: center;
    }

    .auth-controls {
        justify-content: center;
    }

    .card-image {
        width: 40px;
        height: 56px;
    }

    .card-checkbox-item label {
        gap: 8px;
    }

    .card-details {
        gap: 2px;
    }

    .card-name {
        font-size: 13px;
    }

    /* Scale down image preview on mobile */
    .image-preview {
        max-width: 250px;
        font-size: 0.8rem;
    }

    .image-preview .preview-image {
        max-height: 280px;
    }
}