/* LobstaKit Custom Styles — Lobsta Brand Palette */

/* Card Component */
.card {
    background-color: #171717;
    border: 1px solid #262626;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

/* Button Components */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    font-size: 0.875rem;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px #0A0A0A, 0 0 0 4px #DC2626;
}

.btn-primary {
    background-color: #DC2626;
    color: #fff;
}
.btn-primary:hover:not(:disabled) {
    background-color: #991B1B;
}

.btn-secondary {
    background-color: #262626;
    color: #fff;
}
.btn-secondary:hover:not(:disabled) {
    background-color: #404040;
}

.btn-success {
    background-color: #22c55e;
    color: #fff;
}
.btn-success:hover:not(:disabled) {
    background-color: #16a34a;
}

.btn-warning {
    background-color: #f59e0b;
    color: #fff;
}
.btn-warning:hover:not(:disabled) {
    background-color: #d97706;
}

.btn-danger {
    background-color: #ef4444;
    color: #fff;
}
.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* Input Components */
.input {
    background-color: #0A0A0A;
    border: 1px solid #262626;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    color: #fff;
    transition: all 0.2s;
}
.input::placeholder {
    color: #737373;
}
.input:focus {
    outline: none;
    box-shadow: 0 0 0 2px #DC2626;
    border-color: transparent;
}

/* Select styling */
select.input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%23737373'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}
select.input option {
    background: #171717;
    color: #fff;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background-color: #171717;
    border: 1px solid #262626;
    transition: all 0.2s;
    cursor: pointer;
    color: #e5e7eb;
    white-space: nowrap;
}

.step-indicator.active {
    background-color: rgba(220, 38, 38, 0.15);
    border-color: #DC2626;
    color: #EF4444;
}

.step-indicator.completed {
    background-color: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
    color: #22c55e;
}

.step-indicator .step-number {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    background-color: #262626;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
}

.step-indicator.active .step-number {
    background-color: #DC2626;
    color: #fff;
}

.step-indicator.completed .step-number {
    background-color: #22c55e;
    color: #fff;
}

/* Step line active state */
.step-line.active {
    background-color: #DC2626;
}

/* Status Badge */
.status-badge {
    font-weight: 500;
}

/* Toast Animations */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}
.toast {
    animation: slideIn 0.3s ease-out;
}
.toast.hiding {
    animation: slideOut 0.3s ease-in forwards;
}

/* Step content fade animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.step-content:not(.hidden) {
    animation: fadeIn 0.3s ease-out;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Loading Spinner */
.spinner {
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: currentColor;
    border-radius: 50%;
    width: 1em;
    height: 1em;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pulse animation for status dots */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Key Type Segmented Toggle */
.key-type-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.key-type-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #262626;
    background-color: #0A0A0A;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.key-type-option:hover {
    border-color: #404040;
    background-color: #1a1a1a;
}

.key-type-option.selected {
    border-color: #DC2626;
    background-color: rgba(220, 38, 38, 0.1);
}

.key-type-option .key-type-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #e5e7eb;
}

.key-type-option.selected .key-type-title {
    color: #fff;
}

.key-type-option .key-type-desc {
    font-size: 0.6875rem;
    color: #737373;
}

.key-type-option.selected .key-type-desc {
    color: #EF4444;
}

.key-type-instructions {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: #0A0A0A;
    border: 1px solid #262626;
    border-radius: 0.5rem;
}

/* Channel Cards Grid */
.channel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .channel-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .channel-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.channel-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid #262626;
    background-color: #171717;
    cursor: pointer;
    transition: all 0.2s;
}

.channel-card:hover:not(.disabled) {
    border-color: #404040;
    background-color: #1a1a1a;
}

.channel-card.selected {
    border-color: #DC2626;
    background-color: rgba(220, 38, 38, 0.1);
}

.channel-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.channel-card-icon {
    font-size: 1.75rem;
    line-height: 1;
}

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

.channel-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e5e7eb;
}

.channel-card.selected .channel-card-title {
    color: #fff;
}

.channel-card-desc {
    font-size: 0.75rem;
    color: #737373;
    line-height: 1.3;
}

.channel-card.selected .channel-card-desc {
    color: #a3a3a3;
}

.channel-card-sub {
    font-size: 0.6875rem;
    color: #525252;
    line-height: 1.3;
}

.channel-badge-recommended {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 500;
    color: #22c55e;
    background-color: rgba(34, 197, 94, 0.15);
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    vertical-align: middle;
    margin-left: 0.25rem;
}

.channel-badge-soon {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 500;
    color: #737373;
    background-color: rgba(115, 115, 115, 0.15);
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    vertical-align: middle;
    margin-left: 0.25rem;
}

/* Dashboard Channel Cards */
.channel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background-color: #0A0A0A;
    border: 1px solid #262626;
    border-radius: 0.5rem;
    gap: 0.75rem;
}

.channel-row-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.channel-row-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.channel-row-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #e5e7eb;
}

.channel-row-detail {
    font-size: 0.75rem;
    color: #737373;
}

.channel-row-status {
    flex-shrink: 0;
}

.channel-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
}

.channel-status-badge.connected {
    background-color: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.channel-status-badge.not-configured {
    background-color: rgba(115, 115, 115, 0.1);
    color: #737373;
}

.channel-row-actions {
    flex-shrink: 0;
}

.channel-inline-form {
    margin-top: 0.75rem;
    padding: 1rem;
    background-color: #0A0A0A;
    border: 1px solid #262626;
    border-radius: 0.5rem;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 2.75rem;
    height: 1.5rem;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #404040;
    border-radius: 9999px;
    transition: all 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 1.125rem;
    width: 1.125rem;
    left: 0.1875rem;
    bottom: 0.1875rem;
    background-color: #fff;
    border-radius: 50%;
    transition: all 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #DC2626;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(1.25rem);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Download Model Button */
.btn-download-model {
    padding: 0.375rem 0.875rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.8125rem;
    cursor: pointer;
    border: 1px solid #DC2626;
    background-color: transparent;
    color: #DC2626;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-download-model:hover:not(:disabled) {
    background-color: #DC2626;
    color: #fff;
}
.btn-download-model:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Download Progress Bar */
.download-progress-bar {
    width: 100%;
    height: 6px;
    background-color: #262626;
    border-radius: 3px;
    overflow: hidden;
}
.download-progress-fill {
    height: 100%;
    background-color: #DC2626;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Card header badge — prevent overflow/stacking on mobile */
.card-header-badge {
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1.25;
    gap: 0.25rem;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
    .card {
        padding: 1rem;
    }
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}
