/* AppWish Demo - Interactive Components CSS */

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--slate-200);
    min-width: 300px;
    max-width: 500px;
}

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

.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(22, 163, 74, 0.15) 100%);
    color: var(--success);
}

.toast-error .toast-icon {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.15) 100%);
    color: var(--danger);
}

.toast-info .toast-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.15) 100%);
    color: var(--info);
}

.toast-message {
    font-weight: 600;
    color: var(--slate-900);
    line-height: 1.4;
}

/* ============================================
   MODAL OVERLAY
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-overlay.show .modal-container {
    transform: scale(1);
    opacity: 1;
}

.modal-container {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--slate-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
}

.modal-header h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--dark);
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--slate-100);
    color: var(--slate-600);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--slate-200);
    color: var(--slate-900);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: 3px;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--slate-200);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    background: var(--slate-50);
}

/* ============================================
   FORM GROUPS IN MODALS
   ============================================ */
.form-group-modal {
    margin-bottom: 1.5rem;
}

.form-group-modal:last-child {
    margin-bottom: 0;
}

.form-group-modal label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-size: 0.95rem;
}

.modal-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--slate-200);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.2s;
    font-family: inherit;
    background: white;
}

.modal-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-input::placeholder {
    color: var(--slate-400);
}

textarea.modal-input {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* ============================================
   LINK BOX (for sharing links)
   ============================================ */
.link-box {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.link-input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid var(--slate-200);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--slate-50);
    font-family: 'Monaco', monospace;
}

.link-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

/* ============================================
   DOWNLOAD OPTIONS
   ============================================ */
.download-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.download-option {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    border: 2px solid var(--slate-200);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.download-option:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
    transform: translateX(4px);
}

.download-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.download-info {
    flex: 1;
}

.download-title {
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
    color: var(--dark);
}

.download-desc {
    font-size: 0.9rem;
    color: var(--slate-600);
    margin-bottom: 0.5rem;
}

.download-size {
    font-size: 0.85rem;
    color: var(--slate-500);
    font-weight: 600;
}

/* ============================================
   DEPLOY SUCCESS
   ============================================ */
.deploy-success {
    text-align: center;
}

.deploy-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.deploy-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.deploy-stat {
    padding: 1rem;
    background: var(--slate-50);
    border-radius: 10px;
    border: 1px solid var(--slate-200);
}

.deploy-stat .stat-value {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.deploy-stat .stat-label {
    font-size: 0.85rem;
    color: var(--slate-600);
    font-weight: 600;
}

/* ============================================
   BUILD PREVIEW
   ============================================ */
.build-preview {
    width: 100%;
}

.preview-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--slate-200);
}

.preview-tab {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--slate-500);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.preview-tab:hover {
    color: var(--slate-900);
}

.preview-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.preview-frame {
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.preview-browser-bar {
    background: var(--slate-100);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--slate-200);
}

.browser-dots {
    display: flex;
    gap: 0.5rem;
}

.browser-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--slate-300);
}

.browser-url {
    flex: 1;
    background: white;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--slate-600);
    font-family: 'Monaco', monospace;
}

.preview-content {
    min-height: 300px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

/* ============================================
   PREVIEW BOX (for branding customization)
   ============================================ */
.preview-box {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--slate-50);
    border-radius: 10px;
    border: 1px solid var(--slate-200);
}

.preview-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--slate-600);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.portal-preview {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--slate-200);
}

.preview-header {
    padding: 1.5rem;
    color: white;
    transition: background 0.3s;
}

/* ============================================
   SPINNER / LOADING STATE
   ============================================ */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

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

/* ============================================
   SEARCH BOX STATES
   ============================================ */
.search-box.searching::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid var(--slate-300);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.search-box.search-complete::after {
    content: '✓';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--success);
    font-weight: bold;
    animation: none;
}

/* ============================================
   HIRE EXPERT FORM
   ============================================ */
.hire-expert-form .expert-avatar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        min-width: auto;
    }

    .modal-container {
        max-width: 100%;
        margin: 1rem;
    }

    .modal-header {
        padding: 1rem 1.5rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .link-box {
        flex-direction: column;
    }

    .deploy-stats {
        grid-template-columns: 1fr;
    }

    .download-option {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-container {
    animation: scaleIn 0.3s ease;
}