/* portal.css - Clean, professional styling to complement Tailwind CSS */
/* Note: All color variables are defined in branding.css */

:root {
    --border-radius: 12px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Enhanced Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

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

@keyframes pulse-success {
    0%, 100% { 
        background-color: #10b981;
        transform: scale(1);
    }
    50% { 
        background-color: #059669;
        transform: scale(1.05);
    }
}

@keyframes pulse-error {
    0%, 100% { 
        background-color: #ef4444;
        transform: scale(1);
    }
    50% { 
        background-color: #dc2626;
        transform: scale(1.05);
    }
}

/* Enhanced Component Animations */
.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

.slide-in-up {
    animation: slideInUp 0.3s ease-out;
}

.scale-in {
    animation: scaleIn 0.2s ease-out;
}

.pulse-success {
    animation: pulse-success 1s ease-in-out 3;
}

.pulse-error {
    animation: pulse-error 1s ease-in-out 3;
}

/* Enhanced Card Effects */
.card-elevate {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-elevate:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Progress Bar Enhancements */
.progress-bar-animated {
    background: linear-gradient(90deg, rgb(var(--ag-brand-500)), rgb(var(--ag-brand-400)), rgb(var(--ag-blue-400)));
    background-size: 200% 100%;
    animation: gradientShift 2s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Enhanced Status Indicators */
.status-indicator {
    position: relative;
    display: inline-block;
}

.status-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.3;
    animation: ripple 2s infinite;
}

@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

.status-indicator.running::before {
    background-color: rgb(var(--ag-blue-500));
}

.status-indicator.completed::before {
    background-color: rgb(var(--ag-green-500));
}

.status-indicator.failed::before {
    background-color: rgb(var(--ag-red-500));
}

/* Enhanced Button States */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    color: white;
}

.btn-success {
    background-color: rgb(var(--ag-green-500)) !important;
    border-color: rgb(var(--ag-green-500)) !important;
}

.btn-success:hover {
    background-color: rgb(var(--ag-green-600)) !important;
    border-color: rgb(var(--ag-green-600)) !important;
}

/* Enhanced Modal Effects */
.modal-backdrop {
    backdrop-filter: blur(8px);
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    animation: scaleIn 0.2s ease-out;
}

.modal-slide-up {
    animation: slideInUp 0.3s ease-out;
}

/* Table Enhancements */
.table-row-interactive {
    cursor: pointer;
    transition: all 0.2s ease;
}

.table-row-interactive:hover {
    background-color: rgb(var(--ag-accent));
    transform: translateX(2px);
    box-shadow: inset 3px 0 0 rgb(var(--ag-brand));
}

/* Form Enhancements */
.form-group-animated .form-label {
    transition: all 0.2s ease;
    transform-origin: left top;
}

.form-group-animated input:focus + .form-label,
.form-group-animated input:not(:placeholder-shown) + .form-label {
    transform: translateY(-20px) scale(0.8);
    color: rgb(var(--ag-brand));
}

/* Progress Steps Enhancement */
.progress-steps .step {
    position: relative;
    z-index: 1;
}

.progress-steps .step.completed {
    color: rgb(var(--ag-green-500));
}

.progress-steps .step.current {
    color: rgb(var(--ag-brand));
    font-weight: 600;
    transform: scale(1.1);
}

.progress-steps .step::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -50%;
    width: 100%;
    height: 2px;
    background-color: rgb(var(--ag-gray-200));
    z-index: -1;
}

.progress-steps .step.completed::after {
    background-color: rgb(var(--ag-green-500));
}

/* Notification Enhancements */
.notification {
    animation: slideInRight 0.3s ease-out;
    border-left: 4px solid;
}

.notification-success {
    border-left-color: rgb(var(--ag-green-500));
    background: linear-gradient(90deg, rgb(var(--ag-green-500) / 0.1), rgb(var(--ag-green-500) / 0.05));
}

.notification-error {
    border-left-color: rgb(var(--ag-red-500));
    background: linear-gradient(90deg, rgb(var(--ag-red-500) / 0.1), rgb(var(--ag-red-500) / 0.05));
}

.notification-info {
    border-left-color: rgb(var(--ag-brand));
    background: linear-gradient(90deg, rgb(var(--ag-brand) / 0.1), rgb(var(--ag-brand) / 0.05));
}

.notification-warning {
    border-left-color: rgb(var(--ag-orange-500));
    background: linear-gradient(90deg, rgb(var(--ag-orange-500) / 0.1), rgb(var(--ag-orange-500) / 0.05));
}

/* Dashboard Stats Cards */
.stats-card {
    background: linear-gradient(135deg, rgb(var(--ag-background)) 0%, rgb(var(--ag-gray-50)) 100%);
    border: 1px solid rgb(var(--ag-border) / 0.8);
    transition: all 0.3s ease;
}

.stats-card:hover {
    border-color: rgb(var(--ag-brand));
    box-shadow: 0 10px 25px rgb(var(--ag-brand) / 0.1);
}

.stats-number {
    font-feature-settings: 'tnum';
    font-variant-numeric: tabular-nums;
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, rgb(var(--ag-gray-100)) 25%, rgb(var(--ag-gray-200)) 50%, rgb(var(--ag-gray-100)) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Micro-interactions */
.interactive {
    transition: all 0.2s ease;
}

.interactive:hover {
    transform: translateY(-1px);
}

.interactive:active {
    transform: translateY(0);
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break-before {
        page-break-before: always;
    }
    
    .print-break-after {
        page-break-after: always;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* Responsive Enhancements */
@media (max-width: 640px) {
    .mobile-stack > * {
        width: 100% !important;
        margin-bottom: 0.5rem;
    }
    
    .mobile-hide {
        display: none !important;
    }
    
    .modal-content {
        margin: 1rem;
        width: auto;
        max-height: 90vh;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.focus-visible,
*:focus-visible {
    outline: 2px solid rgb(var(--ag-brand-500));
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --ag-gray-200: 0 0 0;
        --ag-gray-500: 0 0 0;
        --ag-gray-700: 0 0 0;
        --ag-border: 0 0 0;
    }
    
    .border-ag-border {
        border-color: rgb(var(--ag-gray-200)) !important;
    }
    
    .text-ag-gray-500 {
        color: rgb(var(--ag-gray-700)) !important;
    }
}
