/* static/css/components.css */

/* Glassmorphism Card */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    position: relative;
    z-index: 1;
}
.glass-card:has(helix-select.open) {
    z-index: 2;
}
.glass-card.danger-zone {
    border-left: 4px solid var(--danger-color);
}
.glass-card h3.danger-zone-title {
    color: var(--danger-color);
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-lg);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: var(--spacing-md);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font-family-primary);
    transition: var(--transition-fast);
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

input::placeholder, textarea::placeholder {
    color: rgba(255,255,255,0.7);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

input:read-only {
    background: rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.3);
    color: var(--gray-400);
    cursor: not-allowed;
}

/* Styled File Input */
.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}
.file-input-wrapper input[type=file] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
}
.file-input-wrapper .btn {
    width: 100%;
    justify-content: flex-start;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    gap: var(--spacing-sm);
    height: 50px;
}

a.btn {
    height: 50px;
}

a.btn.btn-small {
    height: 35px;
}

.btn-primary { background: var(--bg-gradient-primary); color: white; box-shadow: var(--shadow-md); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-secondary { background: rgba(255, 255, 255, 0.2); color: white; border: 1px solid rgba(255, 255, 255, 0.3); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.3); transform: translateY(-1px); }
.btn-danger { background: var(--danger-color); color: white; }
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); }
.btn-warning { background: var(--warning-color); color: white; }
.btn-warning:hover { background: #d97706; }
.btn-success { background: var(--success-color); color: white; }
.btn-success:hover { background: #059669; transform: translateY(-1px); }
.btn-info { background: #3b82f6; color: white; } /* Added for move button */
.btn-info:hover { background: #2563eb; }

.btn-small { padding: var(--spacing-sm) var(--spacing-md); font-size: 0.875rem; height: 35px; }
.btn-xs { padding: var(--spacing-xs) var(--spacing-sm); font-size: 0.75rem; min-width: 32px; min-height: 32px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Tags */
.tag {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.1rem 0.8rem;
    padding-bottom: 0.2rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    background: var(--success-color);
    color: white;
    white-space: nowrap;
}
.collection-tag {
    background: rgba(99, 102, 241, 0.2);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.3);
}
.no-tags-placeholder {
    color: rgba(255,255,255,0.6);
    font-style: italic;
}
.tag-light-bg {
    background: rgba(255,255,255,0.2);
}

/* Alerts / Flash Messages */
.messages-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
    isolation: isolate;
}
.flash {
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border-radius: var(--radius-md);
    font-weight: 500;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}
.flash.success { background: rgba(16, 185, 129, 0.1); color: #d1fae5; border: 1px solid rgba(16, 185, 129, 0.3); }
.flash.error { background: rgba(239, 68, 68, 0.1); color: #fee2e2; border: 1px solid rgba(239, 68, 68, 0.3); }
.flash.warning { background: rgba(245, 158, 11, 0.1); color: #fef3c7; border: 1px solid rgba(245, 158, 11, 0.3); }

/* Search Box */
.search-box-wrapper {
    position: relative;
    width: 100%;
    max-width: 350px;
}
input[type="text"].search-input {
    width: 100%;
    padding-left: 2.5rem;
    border-radius: var(--radius-lg);
}
.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.7);
    pointer-events: none;
}

/* Info Blocks */
.info-block {
    background: rgba(255,255,255,0.1);
    padding: 1rem;
    border-radius: 1rem;
    text-align: center;
}
.info-block-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.info-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

/*
 * Collection Cards Layout
 */
.collection-cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.collection-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 1.5rem;
    flex: 1 1 300px; /* Flex-grow, flex-shrink, flex-basis */
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.3s ease;
}

.collection-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.collection-card-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.collection-card-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-grow: 1;
}

.card-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.card-item-label {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-item-value {
    font-size: 1rem;
    color: white;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.collection-card-footer {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/*
 * Responsive adjustments
 */
@media (max-width: 768px) {
    .collection-card {
        flex-basis: 100%; /* Full width on smaller screens */
    }
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    font-weight: 500;
}

.dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.dropdown-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    color: rgba(255, 255, 255, 0.8);
}

.dropdown-menu.show .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: fixed;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 10px 20px rgba(0, 0, 0, 0.3);
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 9999;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.3);
    color: white;
}

.dropdown-item:first-child {
    border-radius: 6px 6px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 6px 6px;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0.25rem 0;
}

@media (max-width: 768px) {
    .dropdown-menu {
        position: fixed;
        top: auto !important;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        border-radius: 12px 12px 0 0;
        border: none;
        border-top: 2px solid rgba(255, 255, 255, 0.3);
        transform: translateY(100%);
        background: #1a1a2e;
        box-shadow: 0 -20px 40px rgba(0, 0, 0, 0.5);
    }

    .dropdown-menu.show {
        transform: translateY(0);
    }
}