/* 
Package Management System Styles - CSS Foundation Integration
============================================================
⚠️ CRITICAL: Integrated with TikZ2SVG CSS Foundation System for consistency
*/

/* 1. Import Foundation Variables (MUST BE FIRST) */
@import url('foundation/master-variables.css');
@import url('foundation/global-base.css');

/* 2. Package Management Specific Styles using Foundation */
.tikz-app .packages-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-white);
    padding: var(--spacing-24) 0;
    text-align: center;
    margin: 12px 0;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

/* Package Request Header - Specific styling for /packages/request page */
.tikz-app .container-fluid > .package-request-header {
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    border-radius: var(--radius-lg);
}

/* Package Request Form - Make container full width with rounded corners and shadow */
.tikz-app .container-fluid > .package-request-form > .container {
    margin: 0;
    max-width: 100%;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg); /* Same shadow as index search container */
    background-color: var(--container-bg-secondary);
    backdrop-filter: var(--container-bg-blur);
}

.tikz-app .container-fluid > .package-request-form > .container > .request-form-card {
    padding: 0;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
}

/* Enhanced contrast for form elements on glass background */
.tikz-app .request-form-card .form-section h3 {
    color: #1a202c; /* Very high contrast - WCAG AAA (16.1:1 ratio on white) */
    font-weight: var(--font-weight-bold);
}

.tikz-app .request-form-card .form-label {
    color: #1a202c; /* Very high contrast - WCAG AAA (16.1:1 ratio on white) */
    font-weight: var(--font-weight-semibold);
}

/* Package Request Form - Add padding */
.tikz-app #packageRequestForm {
    padding: 12px;
}

/* Enhanced contrast for form help text - WCAG AA compliant */
.tikz-app .request-form-card .form-text {
    color: #4a5568; /* High contrast - WCAG AA (7.48:1 ratio on white) */
    font-size: var(--font-size-xs);
    margin-top: var(--spacing-2);
    line-height: var(--line-height-relaxed);
}

/* Enhanced contrast for alert-info elements - WCAG AA compliant */
.tikz-app .alert-info {
    background-color: #e7f3ff; /* Light blue background */
    border-color: #b3d9ff;
    color: #084298; /* Dark blue text for high contrast */
}

.tikz-app .alert-info h6 {
    color: #052c65; /* Very dark blue for headers - WCAG AAA (12.1:1 ratio) */
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-8);
}

.tikz-app .alert-info p,
.tikz-app .alert-info li {
    color: #084298; /* Dark blue text - WCAG AA (8.2:1 ratio on light blue bg) */
    margin-bottom: var(--spacing-6);
}

.tikz-app .alert-info strong {
    color: #052c65; /* Very dark blue for emphasis */
    font-weight: var(--font-weight-bold);
}

/* Submit buttons - Compact size, always on one row - MUST BE AFTER TEMPLATE STYLES */
body.tikz-app div.container-fluid section.package-request-form #packageRequestForm div.submit-buttons {
    display: flex;
    gap: var(--spacing-8);
    justify-content: center;
    flex-wrap: nowrap;
    flex-direction: row;
    margin-top: var(--spacing-16);
}

body.tikz-app div.container-fluid section.package-request-form #packageRequestForm div.submit-buttons button.btn.btn-primary.btn-lg,
body.tikz-app div.container-fluid section.package-request-form #packageRequestForm div.submit-buttons a.btn.btn-outline-secondary.btn-lg {
    padding: var(--spacing-6) var(--spacing-12);
    font-size: var(--font-size-sm);
    white-space: nowrap;
    flex-shrink: 0;
    width: auto;
    max-width: none;
}

/* Mobile optimization - even more compact on small screens */
@media (max-width: 768px) {
    body.tikz-app div.container-fluid section.package-request-form #packageRequestForm div.submit-buttons {
        gap: var(--spacing-6);
        flex-direction: row;
    }
    
    body.tikz-app div.container-fluid section.package-request-form #packageRequestForm div.submit-buttons button.btn.btn-primary.btn-lg,
    body.tikz-app div.container-fluid section.package-request-form #packageRequestForm div.submit-buttons a.btn.btn-outline-secondary.btn-lg {
        padding: var(--spacing-5) var(--spacing-8);
        font-size: var(--font-size-xs);
        width: auto;
        flex: 0 0 auto;
    }
    
    body.tikz-app div.container-fluid section.package-request-form #packageRequestForm div.submit-buttons .btn i {
        font-size: var(--font-size-xs);
        margin-right: var(--spacing-2);
    }
}

@media (max-width: 576px) {
    body.tikz-app div.container-fluid section.package-request-form #packageRequestForm div.submit-buttons button.btn.btn-primary.btn-lg,
    body.tikz-app div.container-fluid section.package-request-form #packageRequestForm div.submit-buttons a.btn.btn-outline-secondary.btn-lg {
        padding: var(--spacing-4) var(--spacing-6);
        font-size: 11px;
    }
}

.tikz-app .packages-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--glass-bg-light);
    backdrop-filter: var(--glass-blur-light);
    opacity: 0.1;
}

/* CRITICAL OVERRIDE - Must be at the end of file to override template styles */
/* Force buttons to stay on one row - FINAL OVERRIDE */
body.tikz-app div.container-fluid section.package-request-form div.container div.request-form-card form#packageRequestForm div.submit-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: var(--spacing-8);
    justify-content: center;
    margin-top: var(--spacing-16);
}

body.tikz-app div.container-fluid section.package-request-form div.container div.request-form-card form#packageRequestForm div.submit-buttons button.btn.btn-primary.btn-lg,
body.tikz-app div.container-fluid section.package-request-form div.container div.request-form-card form#packageRequestForm div.submit-buttons a.btn.btn-outline-secondary.btn-lg {
    padding: var(--spacing-6) var(--spacing-12);
    font-size: var(--font-size-sm);
    white-space: nowrap;
    flex-shrink: 0;
    width: auto;
    max-width: none;
    flex: 0 0 auto;
}

/* Mobile - Force row layout */
@media (max-width: 768px) {
    body.tikz-app div.container-fluid section.package-request-form div.container div.request-form-card form#packageRequestForm div.submit-buttons {
        flex-direction: row;
        gap: var(--spacing-6);
    }
    
    body.tikz-app div.container-fluid section.package-request-form div.container div.request-form-card form#packageRequestForm div.submit-buttons button.btn.btn-primary.btn-lg,
    body.tikz-app div.container-fluid section.package-request-form div.container div.request-form-card form#packageRequestForm div.submit-buttons a.btn.btn-outline-secondary.btn-lg {
        padding: var(--spacing-5) var(--spacing-8);
        font-size: var(--font-size-xs);
        width: auto;
        flex: 0 0 auto;
    }
}

@media (max-width: 576px) {
    body.tikz-app div.container-fluid section.package-request-form div.container div.request-form-card form#packageRequestForm div.submit-buttons button.btn.btn-primary.btn-lg,
    body.tikz-app div.container-fluid section.package-request-form div.container div.request-form-card form#packageRequestForm div.submit-buttons a.btn.btn-outline-secondary.btn-lg {
        padding: var(--spacing-4) var(--spacing-6);
        font-size: 11px;
    }
}

/* Tip cards container - Remove margin and enhance contrast */
.tikz-app .package-request-form + .container {
    margin: 0;
    padding: var(--spacing-16) 0;
}

/* Enhanced contrast for tip cards - WCAG AA compliant */
.tikz-app .tip-card {
    background: linear-gradient(135deg, rgb(255 255 255 / 98%) 0%, rgb(249 250 251 / 98%) 100%);
    backdrop-filter: var(--glass-blur-medium);
    border: 2px solid rgb(229 231 235 / 90%);
    border-left: 4px solid var(--info-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-20);
    height: 100%;
    box-shadow: 0 2px 8px rgb(0 0 0 / 6%);
    transition: all var(--transition-fast);
}

.tikz-app .tip-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgb(0 0 0 / 10%);
    border-color: rgb(209 213 219 / 95%);
    border-left-color: var(--info-dark);
}

.tikz-app .tip-card h4 {
    color: #1a202c; /* Very high contrast - WCAG AAA (16.1:1 ratio) */
    margin-bottom: var(--spacing-12);
    display: flex;
    align-items: center;
    gap: var(--spacing-6);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
}

.tikz-app .tip-card .tip-icon {
    color: var(--info-color);
    font-size: var(--font-size-lg);
}

.tikz-app .tip-card p {
    color: #374151; /* High contrast - WCAG AA (8.9:1 ratio) */
    line-height: var(--line-height-relaxed);
    margin: 0;
    font-size: var(--font-size-base);
}

.tikz-app .tip-card p a {
    color: var(--info-color);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
    transition: color var(--transition-fast);
}

.tikz-app .tip-card p a:hover {
    color: var(--info-dark);
    text-decoration: underline;
}

/* Specific styling for third tip card - reduced padding and enhanced contrast */
body.tikz-app div.container-fluid section.helpful-tips div.container div.row div:nth-child(3) div.tip-card {
    padding: 6px;
}

body.tikz-app div.container-fluid section.helpful-tips div.container div.row div:nth-child(3) div.tip-card h4 {
    color: #000000; /* Maximum contrast - WCAG AAA (21:1 ratio) */
    font-weight: var(--font-weight-extrabold);
    text-shadow: none;
    background-color: rgba(255, 255, 255, 0.9);
    padding: var(--spacing-2);
    border-radius: var(--radius-sm);
}

.tikz-app .packages-header h1,
.tikz-app .packages-header p {
    position: relative;
    z-index: 2;
    margin: 0;
}

.tikz-app .packages-header h1 {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-4);
}

.tikz-app .packages-header p {
    font-size: var(--font-size-lg);
    opacity: 0.9;
}

/* Package Statistics Cards - Enhanced Contrast & Compact */
.tikz-app .package-stats {
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tikz-app .package-stats > div {
    margin: 0 auto;
}

.tikz-app .package-stats > div > div {
    margin: 0 auto;
    justify-content: center;
}

/* Note: Using padding instead of gap to work with Bootstrap grid */
.tikz-app .package-stats .col-sm-4 {
    padding-left: 6px;
    padding-right: 6px;
}

/* Ensure 3 columns on sm and above (≥576px) */
@media (width >= 576px) {
    .tikz-app .package-stats .col-sm-4 {
        flex: 0 0 auto;
        width: 33.3333%;
        max-width: 33.3333%;
    }
}

.tikz-app .stat-card {
    background: linear-gradient(135deg, rgb(255 255 255 / 98%) 0%, rgb(249 250 251 / 98%) 100%);
    backdrop-filter: var(--glass-blur-medium);
    border: 2px solid rgb(229 231 235 / 90%);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgb(0 0 0 / 6%);
    padding: var(--spacing-16);
    text-align: center;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tikz-app .stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.tikz-app .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgb(0 0 0 / 10%);
    border-color: var(--primary-color);
}

.tikz-app .stat-card:hover::before {
    opacity: 0.04;
}

.tikz-app .stat-card h3 {
    font-size: var(--font-size-2xl);
    color: #1a202c; /* High contrast - WCAG AAA */
    margin: 0;
    font-weight: var(--font-weight-bold);
    position: relative;
    z-index: 2;
}

.tikz-app .stat-card p {
    color: #374151; /* High contrast - WCAG AAA */
    margin: var(--spacing-3) 0 0 0;
    font-weight: var(--font-weight-medium);
    position: relative;
    z-index: 2;
    font-size: var(--font-size-sm);
    line-height: var(--line-height-snug);
}

.tikz-app .stat-icon {
    color: var(--primary-color);
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-4);
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 1px 2px rgb(0 0 0 / 10%));
}

/* Package Search Section */
.tikz-app .package-search {
    padding: 0 var(--spacing-16);
    margin-bottom: var(--spacing-32);
}

.tikz-app .search-input-wrapper {
    position: relative;
}

.tikz-app .search-input-wrapper i {
    position: absolute;
    left: var(--spacing-12);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 3;
}

.tikz-app .package-search input {
    padding: var(--spacing-8) var(--spacing-12) var(--spacing-8) var(--spacing-20);
    border: 1px solid var(--border-light);
    background: var(--glass-bg-light);
    backdrop-filter: var(--glass-blur-light);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: var(--font-size-base);
}

.tikz-app .package-search input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgb(25 118 210 / 20%);
    background: var(--glass-bg-strong);
    outline: none;
}

.tikz-app .package-search select {
    border: 1px solid var(--border-light);
    background: var(--glass-bg-light);
    backdrop-filter: var(--glass-blur-light);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    padding: var(--spacing-8) var(--spacing-12);
    font-size: var(--font-size-base);
}

.tikz-app .package-search select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgb(25 118 210 / 20%);
    outline: none;
}

/* Usage Instructions - Enhanced Contrast & Accessibility */
.tikz-app .usage-instructions {
    background: linear-gradient(135deg, rgb(249 250 251 / 98%) 0%, rgb(243 244 246 / 98%) 100%);
    backdrop-filter: var(--glass-blur-light);
    padding: var(--spacing-32);
    margin-bottom: var(--spacing-32);
    border-radius: var(--radius-lg);
    border: 2px solid rgb(229 231 235 / 90%);
    box-shadow: 0 4px 16px rgb(0 0 0 / 8%);
    position: relative;
    overflow: hidden;
}

.tikz-app .usage-instructions::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color), var(--success-color));
    opacity: 0.8;
}

.tikz-app .usage-instructions h2 {
    color: #1a202c; /* Very high contrast - WCAG AAA */
    margin-bottom: var(--spacing-24);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-2xl);
    text-shadow: 0 1px 2px rgb(255 255 255 / 80%);
}

.tikz-app .instruction-card {
    background: linear-gradient(135deg, rgb(255 255 255 / 98%) 0%, rgb(249 250 251 / 98%) 100%);
    backdrop-filter: var(--glass-blur-medium);
    border: 2px solid rgb(229 231 235 / 95%);
    border-left: 5px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-20);
    transition: all var(--transition-fast);
    height: 100%;
    margin-bottom: var(--spacing-16);
    box-shadow: 0 2px 8px rgb(0 0 0 / 6%);
    position: relative;
}

.tikz-app .instruction-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
    border-radius: var(--radius-md);
    pointer-events: none;
}

.tikz-app .instruction-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgb(0 0 0 / 12%);
    border-color: rgb(209 213 219 / 95%);
    border-left-color: var(--success-color);
}

.tikz-app .instruction-card:hover::before {
    opacity: 0.04;
}

.tikz-app .instruction-card h3 {
    color: #1a202c; /* Very high contrast - WCAG AAA */
    margin: var(--spacing-8) 0 var(--spacing-12) 0;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    position: relative;
    z-index: 1;
}

.tikz-app .instruction-card p {
    color: #374151; /* High contrast - WCAG AA */
    line-height: var(--line-height-relaxed);
    margin: var(--spacing-6) 0;
    position: relative;
    z-index: 1;
    font-size: var(--font-size-base);
}

.tikz-app .instruction-card code {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #1e293b; /* Very high contrast for code */
    padding: var(--spacing-3) var(--spacing-6);
    border-radius: var(--radius-sm);
    font-family: var(--font-family-mono);
    border: 1.5px solid rgb(209 213 219 / 90%);
    display: inline-block;
    margin: var(--spacing-6) 0;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    position: relative;
    z-index: 1;
    box-shadow: 0 1px 3px rgb(0 0 0 / 5%);
    transition: all var(--transition-fast);
    max-width: 100%;
    word-break: break-all;
    overflow-wrap: break-word;
}

.tikz-app .instruction-card code:hover {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgb(0 0 0 / 8%);
}

.tikz-app .instruction-icon {
    color: var(--primary-color);
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-4);
    display: block;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 1px 2px rgb(0 0 0 / 10%));
}


/* Two-Column Package Layout - Enhanced Contrast */
.tikz-app .package-column {
    height: 100%;
}

.tikz-app .column-header {
    background: linear-gradient(135deg, rgb(249 250 251 / 98%) 0%, rgb(243 244 246 / 98%) 100%);
    backdrop-filter: var(--glass-blur);
    border: 2px solid rgb(229 231 235 / 90%);
    border-radius: var(--radius-lg);
    padding: var(--spacing-16);
    margin-bottom: var(--spacing-16);
    text-align: center;
    box-shadow: 0 2px 8px rgb(0 0 0 / 6%);
}

.tikz-app .column-header h2 {
    color: #1a202c; /* High contrast - WCAG AAA */
    margin-bottom: var(--spacing-4);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
}

.tikz-app .column-header p {
    color: #374151; /* High contrast - WCAG AA */
    margin: 0;
    font-size: var(--font-size-sm);
}

/* Active Column Styling - Enhanced */
.tikz-app .active-column .column-header {
    border-left: 5px solid var(--success-color);
    background: linear-gradient(135deg, rgb(236 253 245 / 98%) 0%, rgb(243 244 246 / 98%) 100%);
}

.tikz-app .active-column .active-card {
    border-left: 4px solid var(--success-color);
}

/* Manual Column Styling - Enhanced */
.tikz-app .manual-column .column-header {
    border-left: 5px solid var(--warning-color);
    background: linear-gradient(135deg, rgb(254 252 232 / 98%) 0%, rgb(243 244 246 / 98%) 100%);
}

.tikz-app .manual-column .manual-card {
    border-left: 4px solid var(--warning-color);
}

/* Package Categories - Legacy Support */
.tikz-app .package-category {
    margin-bottom: var(--spacing-32);
}

.tikz-app .package-category h2 {
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: var(--spacing-8);
    margin-bottom: var(--spacing-24);
    font-weight: var(--font-weight-bold);
    display: flex;
    align-items: center;
    gap: var(--spacing-8);
    font-size: var(--font-size-2xl);
}

.tikz-app .package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-12);
    max-height: 600px;
    overflow-y: auto;
    padding: var(--spacing-8);
    background: var(--glass-bg-subtle);
    border-radius: var(--radius-md);
}

/* Simplified Package Cards for 2-Column Layout - Enhanced Contrast */
.tikz-app .package-card {
    background: linear-gradient(135deg, rgb(255 255 255 / 98%) 0%, rgb(249 250 251 / 95%) 100%);
    backdrop-filter: var(--glass-blur);
    border: 1.5px solid rgb(229 231 235 / 90%);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 36px;
    box-shadow: 0 1px 3px rgb(0 0 0 / 4%);
}

.tikz-app .package-card .card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--spacing-3) var(--spacing-6);
    position: relative;
    z-index: 1;
}

.tikz-app .package-card .package-name {
    font-weight: var(--font-weight-medium);
    color: #1a202c; /* High contrast - WCAG AAA */
    cursor: pointer;
    font-family: 'Roboto Mono', monospace;
    font-size: var(--font-size-sm);
    flex: 1;
    transition: color var(--transition-fast);
}

.tikz-app .package-card .package-name:hover {
    color: var(--primary-color);
}

.tikz-app .package-card .package-actions {
    margin-left: var(--spacing-12);
}

/* Copy Button - Base Styles (must come before more specific selectors) */
.tikz-app .copy-btn {
    background: transparent;
    border: 1.5px solid rgb(209 213 219 / 90%);
    color: #52525b; /* Enhanced contrast - Gray-600 */
    padding: var(--spacing-2) var(--spacing-4);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    position: relative;
    z-index: 2;
}

.tikz-app .copy-btn:hover {
    background: linear-gradient(135deg, rgb(249 250 251 / 98%) 0%, rgb(243 244 246 / 98%) 100%);
    color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 1px 3px rgb(0 0 0 / 8%);
}

/* Package Card Specific Copy Button Overrides */
.tikz-app .package-card .copy-btn {
    padding: var(--spacing-4) var(--spacing-8);
    font-size: var(--font-size-xs);
    border-radius: var(--radius-sm);
}

.tikz-app .package-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 0;
    pointer-events: none;
}

.tikz-app .package-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(0 0 0 / 10%);
    border-color: var(--primary-color);
}

.tikz-app .package-card:hover::before {
    opacity: 0.04;
}

.tikz-app .package-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-12);
    position: relative;
    z-index: 2;
}

.tikz-app .package-card h3 {
    color: var(--primary-color);
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.tikz-app .package-card h3:hover {
    color: var(--primary-dark);
}

.tikz-app .package-card p {
    color: var(--text-secondary);
    margin: 0 0 var(--spacing-12) 0;
    line-height: var(--line-height-relaxed);
    position: relative;
    z-index: 2;
    font-size: var(--font-size-sm);
    flex-grow: 1;
}

.tikz-app .package-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-xs);
    position: relative;
    z-index: 2;
    margin-top: auto;
    padding-top: var(--spacing-8);
    border-top: 1px solid var(--border-muted);
}

.tikz-app .usage-count {
    color: var(--success-color);
    font-weight: var(--font-weight-medium);
}

.tikz-app .doc-link {
    color: var(--info-color);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    transition: color var(--transition-fast);
}

.tikz-app .doc-link:hover {
    color: var(--info-dark);
}

/* Package Request Section - Enhanced Contrast */
.tikz-app .package-request {
    padding: 0;
    margin-bottom: var(--spacing-32);
    display: flex;
    justify-content: center;
    align-items: center;
}

.tikz-app .package-request > div {
    margin: 0;
}

.tikz-app .request-card {
    background: linear-gradient(135deg, rgb(239 246 255 / 98%) 0%, rgb(243 244 246 / 98%) 100%);
    backdrop-filter: var(--glass-blur-medium);
    border: 2px solid rgb(191 219 254 / 90%);
    border-radius: var(--radius-xl);
    padding: var(--spacing-24);
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgb(0 0 0 / 8%);
}

.tikz-app .request-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color), var(--primary-light));
    opacity: 0.9;
    z-index: 0;
}

.tikz-app .request-card h2 {
    color: #1a202c; /* High contrast - WCAG AAA */
    margin-bottom: var(--spacing-12);
    position: relative;
    z-index: 2;
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
}

.tikz-app .request-card p {
    color: #374151; /* High contrast - WCAG AAA */
    margin-bottom: var(--spacing-20);
    position: relative;
    z-index: 2;
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
}

.tikz-app .request-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: var(--text-white);
    border: none;
    padding: var(--spacing-10) var(--spacing-20);
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-semibold);
    transition: all var(--transition-fast);
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 12px rgb(25 118 210 / 25%);
    font-size: var(--font-size-base);
    text-decoration: none;
    display: inline-block;
}

.tikz-app .request-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgb(25 118 210 / 35%);
    filter: brightness(1.1);
    text-decoration: none;
    color: var(--text-white);
}

/* Responsive Design */
@media (width <= 768px) {
    .tikz-app .package-grid {
        grid-template-columns: 1fr;
    }
    
    .tikz-app .package-meta {
        flex-direction: column;
        gap: var(--spacing-4);
        align-items: flex-start;
    }
    
    .tikz-app .packages-header {
        padding: var(--spacing-20) 0;
    }
    
    .tikz-app .packages-header h1 {
        font-size: var(--font-size-3xl);
    }
    
    .tikz-app .stat-card {
        min-height: 90px;
        padding: var(--spacing-12);
    }
    
    .tikz-app .stat-card h3 {
        font-size: var(--font-size-xl);
    }
    
    .tikz-app .stat-card p {
        font-size: var(--font-size-xs);
        margin: var(--spacing-2) 0 0 0;
    }
    
    .tikz-app .stat-icon {
        font-size: var(--font-size-lg);
        margin-bottom: var(--spacing-2);
    }
    
    /* Usage Instructions Mobile Optimization */
    .tikz-app .usage-instructions {
        padding: var(--spacing-20);
        margin-bottom: var(--spacing-24);
    }
    
    .tikz-app .usage-instructions h2 {
        font-size: var(--font-size-xl);
    }
    
    .tikz-app .instruction-card {
        padding: var(--spacing-16);
        margin-bottom: var(--spacing-12);
    }
    
    .tikz-app .instruction-card h3 {
        font-size: var(--font-size-base);
    }
    
    .tikz-app .instruction-card code {
        font-size: var(--font-size-xs);
        padding: var(--spacing-2) var(--spacing-4);
    }
    
    /* Package Request Mobile Optimization */
    .tikz-app .package-request {
        padding: 0;
        margin-bottom: var(--spacing-24);
    }
    
    .tikz-app .request-card {
        padding: var(--spacing-16);
        border-radius: var(--radius-lg);
    }
    
    .tikz-app .request-card h2 {
        font-size: var(--font-size-xl);
        margin-bottom: var(--spacing-8);
    }
    
    .tikz-app .request-card p {
        font-size: var(--font-size-sm);
        margin-bottom: var(--spacing-16);
    }
    
    .tikz-app .request-btn {
        padding: var(--spacing-8) var(--spacing-16);
        font-size: var(--font-size-sm);
        width: 100%;
        max-width: 280px;
    }
}

/* Loading State */
.tikz-app .package-card.loading {
    background: var(--bg-muted);
    border: 1px solid var(--border-muted);
}

.tikz-app .package-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--glass-bg-light), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Focus States for Accessibility */
.tikz-app .package-search input:focus,
.tikz-app .package-search select:focus,
.tikz-app .copy-btn:focus,
.tikz-app .request-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .tikz-app .stat-card,
    .tikz-app .package-card,
    .tikz-app .instruction-card {
        border-width: 3px;
        border-color: #000;
    }
    
    .tikz-app .stat-card h3,
    .tikz-app .package-card h3,
    .tikz-app .instruction-card h3,
    .tikz-app .usage-instructions h2 {
        color: #000;
        font-weight: var(--font-weight-bold);
    }
    
    .tikz-app .instruction-card p {
        color: #000;
    }
    
    .tikz-app .instruction-card code {
        border-color: #000;
        background: #fff;
        color: #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .tikz-app .instruction-card,
    .tikz-app .stat-card,
    .tikz-app .package-card {
        transition: none;
    }
    
    .tikz-app .instruction-card:hover,
    .tikz-app .stat-card:hover,
    .tikz-app .package-card:hover {
        transform: none;
    }
}

/* Toast Notification Styles - Enhanced Contrast */
#copyToast {
    min-width: 250px;
}

#copyToast .toast-header {
    background: linear-gradient(135deg, rgb(236 253 245 / 98%) 0%, rgb(243 244 246 / 98%) 100%);
    border-bottom: 2px solid rgb(34 197 94 / 30%);
}

#copyToast .toast-header strong {
    color: #065f46; /* Very high contrast - WCAG AAA (10.5:1 ratio on light green bg) */
    font-weight: var(--font-weight-bold);
}

#copyToast .toast-body {
    background: linear-gradient(135deg, rgb(255 255 255 / 98%) 0%, rgb(249 250 251 / 98%) 100%);
    color: #1a202c; /* Very high contrast - WCAG AAA (16.1:1 ratio on white) */
    font-weight: var(--font-weight-medium);
    padding: var(--spacing-12) var(--spacing-16);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
}

/* Print Styles */
@media print {
    .tikz-app .usage-instructions {
        background: #fff;
        border: 2px solid #000;
        page-break-inside: avoid;
    }
    
    .tikz-app .instruction-card {
        background: #fff;
        border: 1px solid #000;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .tikz-app .instruction-card code {
        background: #f5f5f5;
        border: 1px solid #000;
    }
}
