/* ========================================
   Additional Components & Utilities
   AWS Community Day Argentina 2025
   ======================================== */

/* ========================================
   Skip Link for Accessibility
   ======================================== */

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary);
    color: var(--white);
    padding: 8px;
    text-decoration: none;
    border-radius: var(--radius-sm);
    z-index: 10000;
    font-weight: 600;
    transition: top var(--transition-normal);
}

.skip-link:focus {
    top: 6px;
    color: var(--white);
}

/* ========================================
   Keyboard Navigation Focus Styles
   ======================================== */

.keyboard-navigation *:focus {
    outline: 3px solid var(--primary) !important;
    outline-offset: 2px !important;
}

.keyboard-navigation .btn:focus {
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.3) !important;
}

/* ========================================
   Scroll to Top Button
   ======================================== */

.scroll-to-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-lg);
    font-size: var(--fs-lg);
}

.scroll-to-top-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.scroll-to-top-btn:active {
    transform: translateY(-1px);
}

/* ========================================
   Loading Screen Enhancements
   ======================================== */

.loading-screen .aws-logo-loader {
    position: relative;
}

.loading-screen .aws-logo-loader::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   Enhanced Form Styles
   ======================================== */

.form-control {
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    font-size: var(--fs-base);
    transition: all var(--transition-normal);
    background: var(--white);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.1);
    background: var(--white);
}

.form-control:invalid {
    border-color: var(--error);
}

.form-control:valid {
    border-color: var(--success);
}

/* ========================================
   Enhanced Alert Styles
   ======================================== */

.alert {
    border: none;
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-left-color: var(--success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border-left-color: var(--error);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border-left-color: var(--warning);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
    border-left-color: var(--info);
}

/* ========================================
   Enhanced Modal Styles
   ======================================== */

.modal-content {
    border: none;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
}

.modal-header {
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem;
}

.modal-title {
    font-family: var(--font-secondary);
    font-weight: 700;
    color: var(--gray-900);
}

.modal-body {
    padding: 1.5rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    opacity: 0.6;
    transition: opacity var(--transition-normal);
}

.btn-close:hover {
    opacity: 1;
}

/* ========================================
   Enhanced Badge Styles
   ======================================== */

.badge {
    font-size: 0.75em;
    font-weight: 600;
    padding: 0.5em 0.75em;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.bg-primary-gradient {
    background: var(--gradient-primary);
    color: var(--white);
}

/* ========================================
   Card Enhancements
   ======================================== */

.card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    padding: 1.5rem;
}

/* ========================================
   List Group Enhancements
   ======================================== */

.list-group-item {
    border: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
    transition: all var(--transition-normal);
}

.list-group-item:hover {
    background: var(--gray-50);
}

.list-group-item.active {
    background: var(--gradient-primary);
    border-color: var(--primary);
    color: var(--white);
}

/* ========================================
   Progress Bar Enhancements
   ======================================== */

.progress {
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    background: var(--gradient-primary);
    transition: width 0.6s ease;
    border-radius: var(--radius-full);
}

.progress-bar.animated {
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    0% { background-position: 40px 0; }
    100% { background-position: 0 0; }
}

/* ========================================
   Tooltip Enhancements
   ======================================== */

.tooltip {
    font-size: var(--fs-sm);
    z-index: 1070;
}

.tooltip-inner {
    background: var(--gray-900);
    color: var(--white);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.tooltip.show {
    opacity: 1;
}

/* ========================================
   Dropdown Enhancements
   ======================================== */

.dropdown-menu {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}

.dropdown-item {
    padding: 0.75rem 1.5rem;
    transition: all var(--transition-normal);
    color: var(--gray-700);
}

.dropdown-item:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

.dropdown-item:active {
    background: var(--primary);
    color: var(--white);
}

/* ========================================
   Spinner/Loading Animations
   ======================================== */

.spinner-border {
    width: 2rem;
    height: 2rem;
    border: 0.25em solid;
    border-color: var(--primary) transparent var(--primary) transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.1em;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

.spinner-grow {
    width: 2rem;
    height: 2rem;
    background-color: var(--primary);
    border-radius: 50%;
    opacity: 0;
    animation: spinner-grow 0.75s linear infinite;
}

.spinner-grow-sm {
    width: 1rem;
    height: 1rem;
}

@keyframes spinner-grow {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* ========================================
   Breadcrumb Enhancements
   ======================================== */

.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item {
    font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '>';
    color: var(--gray-400);
    font-weight: 600;
}

.breadcrumb-item.active {
    color: var(--primary);
}

/* ========================================
   Pagination Enhancements
   ======================================== */

.pagination {
    gap: 0.5rem;
}

.page-link {
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-lg);
    color: var(--gray-700);
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.page-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    transform: translateY(-1px);
}

.page-item.active .page-link {
    background: var(--gradient-primary);
    border-color: var(--primary);
    color: var(--white);
}

.page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   Table Enhancements
   ======================================== */

.table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead th {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    font-weight: 600;
    color: var(--gray-900);
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    transition: background-color var(--transition-normal);
}

.table tbody tr:hover td {
    background: var(--gray-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ========================================
   Input Group Enhancements
   ======================================== */

.input-group {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.input-group .form-control {
    border-radius: 0;
    border-right: none;
}

.input-group .form-control:focus {
    z-index: 3;
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.1);
}

.input-group .btn {
    border-radius: 0;
    border-left: none;
    z-index: 2;
}

.input-group .form-control:first-child {
    border-top-left-radius: var(--radius-lg);
    border-bottom-left-radius: var(--radius-lg);
}

.input-group .btn:last-child {
    border-top-right-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

/* ========================================
   Accordion Enhancements
   ======================================== */

.accordion {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.accordion-item {
    border: 1px solid var(--gray-200);
    border-bottom: none;
}

.accordion-item:last-child {
    border-bottom: 1px solid var(--gray-200);
}

.accordion-header {
    margin-bottom: 0;
}

.accordion-button {
    background: var(--white);
    border: none;
    padding: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    transition: all var(--transition-normal);
}

.accordion-button:hover {
    background: var(--gray-50);
}

.accordion-button:not(.collapsed) {
    background: var(--primary);
    color: var(--white);
}

.accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    transition: transform var(--transition-normal);
}

.accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    transform: rotate(180deg);
}

.accordion-body {
    padding: 1.5rem;
    background: var(--white);
}

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

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

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

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

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

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-20px);
    }
    70% {
        transform: translateY(-10px);
    }
    90% {
        transform: translateY(-4px);
    }
}

/* Animation classes */
.animate-slide-in-up {
    animation: slideInUp 0.6s ease-out;
}

.animate-slide-in-down {
    animation: slideInDown 0.6s ease-out;
}

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

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.animate-zoom-in {
    animation: zoomIn 0.6s ease-out;
}

.animate-bounce {
    animation: bounce 1s ease-in-out;
}

/* ========================================
   Utility Classes
   ======================================== */

/* Text utilities */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-shadow-lg {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Background utilities */
.bg-gradient-primary {
    background: var(--gradient-primary);
}

.bg-gradient-secondary {
    background: var(--gradient-secondary);
}

.bg-gradient-rainbow {
    background: var(--gradient-rainbow);
}

/* Border utilities */
.border-gradient {
    border: 2px solid;
    border-image: var(--gradient-primary) 1;
}

/* Shadow utilities */
.shadow-xs {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadow-inner {
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

.shadow-glow {
    box-shadow: 0 0 20px rgba(255, 153, 0, 0.3);
}

/* Spacing utilities */
.gap-xs { gap: var(--spacing-xs); }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
.gap-xl { gap: var(--spacing-xl); }

/* Flex utilities */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-around {
    display: flex;
    align-items: center;
    justify-content: space-around;
}

/* Position utilities */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* Z-index utilities */
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* Overflow utilities */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-scroll { overflow: scroll; }

/* Transform utilities */
.rotate-45 { transform: rotate(45deg); }
.rotate-90 { transform: rotate(90deg); }
.rotate-180 { transform: rotate(180deg); }
.scale-105 { transform: scale(1.05); }
.scale-110 { transform: scale(1.1); }

/* Transition utilities */
.transition-all { transition: all var(--transition-normal); }
.transition-colors { transition: color var(--transition-normal), background-color var(--transition-normal), border-color var(--transition-normal); }
.transition-transform { transition: transform var(--transition-normal); }

/* Hover utilities */
.hover-scale:hover { transform: scale(1.05); }
.hover-lift:hover { transform: translateY(-2px); }
.hover-shadow:hover { box-shadow: var(--shadow-lg); }

/* Focus utilities */
.focus-outline:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    .page-break-before {
        page-break-before: always;
    }
    
    .page-break-after {
        page-break-after: always;
    }
    
    .page-break-inside-avoid {
        page-break-inside: avoid;
    }
}

/* ========================================
   Dark Mode (Future Enhancement)
   ======================================== */

@media (prefers-color-scheme: dark) {
    .dark-mode-preference {
        background-color: #1a1a1a;
        color: #ffffff;
    }
}

/* ========================================
   High Contrast Mode
   ======================================== */

@media (prefers-contrast: high) {
    .high-contrast {
        /* High contrast mode styles */
        --primary: #000000;
        --secondary: #ffffff;
        --gray-700: #000000;
        --gray-600: #000000;
    }
}

/* ========================================
   Reduced Motion
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .reduce-motion * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
