/**
 * Premium Theme - Unified styling for professional medical application
 * Ensures consistent, high-quality UI/UX across all Radionox calculators
 */

/* Enhanced Card Animations */
@keyframes cardEntry {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 4px 20px var(--shadow-color);
    }
    50% {
        box-shadow: 0 8px 30px var(--shadow-color), 0 0 20px rgba(255, 255, 255, 0.05);
    }
}

/* Premium Card Styles */
.card {
    /* animation: cardEntry 0.6s ease-out; - Removed for static display */
    position: relative;
    overflow: hidden;
    opacity: 1;
    transform: translateY(0);
}

.card::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        transparent,
        rgba(255, 255, 255, 0.03),
        transparent,
        rgba(255, 255, 255, 0.03)
    );
    background-size: 400% 400%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
    /* animation: shimmer 3s ease infinite; - Removed for static display */
}

/* Premium Button Effects */
.button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.button::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.button:active::after {
    width: 300px;
    height: 300px;
}

.button-primary {
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.button-primary:hover {
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.4);
}

/* Premium Input Styles */
input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
    transition: all 0.3s ease;
    position: relative;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    background-color: rgba(255, 255, 255, 0.03);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* Premium Checkbox and Radio Styles */
input[type="checkbox"],
input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    animation: checkPulse 0.3s ease;
}

@keyframes checkPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Enhanced Form Sections */
.form-section {
    position: relative;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

.form-section:hover {
    background: rgba(255, 255, 255, 0.03);
}

.section-title {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, var(--accent-color), var(--accent-hover));
    border-radius: 2px;
}

/* Premium Result Display */
.result-section {
    /* animation: cardEntry 0.6s ease-out; - Removed for static display */
    opacity: 1;
    transform: translateY(0);
}

.impression-result {
    background: linear-gradient(135deg, 
        rgba(16, 185, 129, 0.05),
        rgba(16, 185, 129, 0.02)
    );
    border-left: 4px solid var(--accent-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    transition: all 0.3s ease;
}

.impression-result:hover {
    background: linear-gradient(135deg, 
        rgba(16, 185, 129, 0.08),
        rgba(16, 185, 129, 0.04)
    );
}

/* Premium Badge Styles */
.category-badge,
.cac-category-badge,
.cad-category-badge {
    position: relative;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    /* animation: pulseGlow 3s ease-in-out infinite; - Removed for static display */
}

.category-badge::after,
.cac-category-badge::after,
.cad-category-badge::after {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: inherit;
    border-radius: inherit;
    filter: blur(10px);
    opacity: 0.5;
    z-index: -1;
}

/* Premium Table Styles */
.history-table {
    border-collapse: separate;
    border-spacing: 0 8px;
}

.history-table tbody tr {
    background: var(--card-bg);
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.history-table tbody tr:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.history-table tbody tr td:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.history-table tbody tr td:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Premium Loading States */
.loading-spinner {
    position: relative;
    width: 40px;
    height: 40px;
    margin: 2rem auto;
}

.loading-spinner::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--border-color);
}

.loading-spinner::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--accent-color);
    animation: spin 1s linear infinite;
}

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

/* Premium Tooltips */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
}

[data-tooltip]:hover::after {
    transform: translateX(-50%) scale(1);
}

/* Premium Scroll Effects */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Premium Focus States */
:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

/* Premium Selection Colors */
::selection {
    background: rgba(16, 185, 129, 0.3);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(16, 185, 129, 0.3);
    color: var(--text-primary);
}

/* Premium Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-bg);
    border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-color), var(--accent-hover));
    border-radius: var(--radius-md);
    border: 2px solid var(--secondary-bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* Responsive Premium Adjustments */
@media (max-width: 768px) {
    .card {
        animation-duration: 0.4s;
    }
    
    .form-section {
        padding: 1rem;
    }
    
    .section-title {
        font-size: var(--font-md);
    }
}

/* Premium Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .button {
        display: none;
    }
    
    .impression-result {
        border-left: 3px solid black;
        background: #f5f5f5;
    }
}