/* Admin Actions Design System
   ------------------------------------------------------------------
   Purpose: Provide a single source of truth for action/icon buttons.
   Usage:
     1. Include /css/admin-actions.css in any management/admin page.
     2. Wrap actions in .action-container.
     3. Use .action-icon with semantic modifiers (.action-icon--primary,
        .action-icon--danger, etc). Prefer icons over text buttons.
   ------------------------------------------------------------------ */

:root {
    --action-icon-size: 32px;
    --action-icon-radius: 999px;
    --action-icon-gap: 16px;
    --action-icon-bg: #f3f4f6;
    --action-icon-color: #1f2937;
    --action-icon-hover-bg: #111827;
    --action-icon-hover-color: #fff;
}

.action-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--action-icon-gap);
}

.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--action-icon-size);
    height: var(--action-icon-size);
    border-radius: var(--action-icon-radius);
    background: var(--action-icon-bg);
    color: var(--action-icon-color);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.action-icon svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.action-icon:hover {
    background: var(--action-icon-hover-bg);
    color: var(--action-icon-hover-color);
    transform: scale(1.1);
}

.action-icon:disabled,
.action-icon.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
}

.action-icon--primary,
.view-icon {
    color: #2563eb;
    background: transparent;
}

.action-icon--primary:hover,
.view-icon:hover {
    background: #2563eb;
    color: #fff;
}

.action-icon--success,
.edit-icon,
.create-icon,
.save-icon {
    color: #16a34a;
    background: transparent;
}

.action-icon--success:hover,
.edit-icon:hover,
.create-icon:hover,
.save-icon:hover {
    background: #16a34a;
    color: #fff;
}

.action-icon--warning,
.permissions-icon {
    color: #b45309;
    background: transparent;
}

.action-icon--warning:hover,
.permissions-icon:hover {
    background: #b45309;
    color: #fff;
}

.action-icon--danger,
.delete-icon {
    color: #dc2626;
    background: transparent;
}

.action-icon--danger:hover,
.delete-icon:hover {
    background: #dc2626;
    color: #fff;
}

.action-icon--secondary,
.cancel-icon {
    color: #4b5563;
    background: transparent;
}

.action-icon--secondary:hover,
.cancel-icon:hover {
    background: #4b5563;
    color: #fff;
}

.action-icon--info {
    color: #0f766e;
    background: transparent;
}

.action-icon--info:hover {
    background: #0f766e;
    color: #fff;
}

.action-icon.large {
    --action-icon-size: 38px;
}

.action-icon.small {
    --action-icon-size: 26px;
}

/* Utility container when actions stack vertically */
.action-container.stack {
    flex-direction: column;
    align-items: flex-start;
}

/* Projects-specific animation styles */
.project-details .action-icon {
    transform: scale(0.8);
    opacity: 0;
}

.project-details.active .action-icon {
    transform: scale(1);
    opacity: 1;
}



/* Button styles for forms and general use */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    line-height: 1.4;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}

.btn-secondary {
    background: #e5e7eb;
    color: #111827;
}

.btn-secondary:hover:not(:disabled) {
    background: #d1d5db;
}

.btn-tertiary {
    background: transparent;
    color: #2563eb;
}

.btn-tertiary:hover:not(:disabled) {
    background: #e0ecff;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

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

/* Close all button style */
.close-all-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #d1d5db;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    color: #6b7280;
}

.close-all-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

/* Project details actions container */
.project-details-actions,
.template-details-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    :root {
        --action-icon-size: 29px;
        --action-icon-gap: 10px;
    }
}
