/* api.css - Styles for API error handling (permission modals, toasts) */

/* ========================================
   Permission Denied Modal
   ======================================== */

.permission-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.permission-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.permission-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 420px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.3s ease;
}

.permission-modal-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 0.5s ease;
}

.permission-modal-content h2 {
    margin: 0 0 1rem 0;
    color: #ef4444;
    font-size: 1.5rem;
    font-weight: 600;
}

.permission-modal-content p {
    margin: 0 0 0.75rem 0;
    color: #374151;
    font-size: 1rem;
    line-height: 1.5;
}

.permission-modal-hint {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.permission-modal-hint strong {
    color: #3b82f6;
    font-weight: 600;
}

.permission-modal-close {
    margin-top: 1.5rem;
    padding: 0.625rem 2rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.permission-modal-close:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.permission-modal-close:active {
    transform: translateY(0);
}

/* ========================================
   Toast Notifications
   ======================================== */

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 400px;
    min-width: 250px;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #1f2937;
}

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

.toast.toast-success {
    border-left: 4px solid #22c55e;
}

.toast.toast-success::before {
    content: "✓ ";
    color: #22c55e;
    font-weight: bold;
    margin-right: 0.5rem;
}

.toast.toast-error {
    border-left: 4px solid #ef4444;
}

.toast.toast-error::before {
    content: "✕ ";
    color: #ef4444;
    font-weight: bold;
    margin-right: 0.5rem;
}

.toast.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast.toast-info::before {
    content: "ⓘ ";
    color: #3b82f6;
    font-weight: bold;
    margin-right: 0.5rem;
}

.toast.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast.toast-warning::before {
    content: "⚠ ";
    color: #f59e0b;
    font-weight: bold;
    margin-right: 0.5rem;
}

/* ========================================
   Animations
   ======================================== */

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ========================================
   Mobile Responsive
   ======================================== */

@media (max-width: 640px) {
    .permission-modal-content {
        width: 95%;
        padding: 1.5rem;
    }

    .permission-modal-icon {
        font-size: 3rem;
    }

    .permission-modal-content h2 {
        font-size: 1.25rem;
    }

    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

/* ========================================
   Dark Mode (Optional)
   ======================================== */

@media (prefers-color-scheme: dark) {
    .permission-modal-backdrop {
        background: rgba(0, 0, 0, 0.8);
    }

    .permission-modal-content {
        background: #1f2937;
        color: #f3f4f6;
    }

    .permission-modal-content p {
        color: #d1d5db;
    }

    .permission-modal-hint {
        color: #9ca3af;
        border-top-color: #374151;
    }

    .toast {
        background: #1f2937;
        color: #f3f4f6;
    }
}
