/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e3f2fd 0%, #f8f9fa 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 20px;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.logo-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1976d2, #42a5f5);
    border-radius: 12px;
    color: white;
    font-size: 36px;
}

.logo-info h1 {
    font-size: 32px;
    color: #1976d2;
    margin-bottom: 8px;
    font-weight: 700;
}

.logo-info p {
    font-size: 16px;
    color: #666;
    font-weight: 400;
}

/* Main Card Styles */
.main-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    flex: 1;
}

.page-title {
    font-size: 36px;
    font-weight: bold;
    color: #1976d2;
    text-align: center;
    margin-bottom: 20px;
}

.intro-text {
    font-size: 18px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 40px;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Forms Grid */
.forms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.form-category {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.form-category:hover {
    background: white;
    border-color: #1976d2;
    box-shadow: 0 8px 25px rgba(25, 118, 210, 0.15);
    transform: translateY(-2px);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.category-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1976d2, #42a5f5);
    border-radius: 10px;
    color: white;
    font-size: 24px;
}

.category-header h3 {
    font-size: 24px;
    color: #1976d2;
    font-weight: 600;
    margin: 0;
}

.form-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.form-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(25, 118, 210, 0.1), transparent);
    transition: left 0.5s;
}

.form-link:hover::before {
    left: 100%;
}

.form-link:hover {
    background: #f0f7ff;
    border-color: #1976d2;
    color: #1976d2;
    transform: translateX(5px);
}

.form-link i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.form-link span {
    font-size: 16px;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 30px;
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #1976d2, #42a5f5);
    border-radius: 12px;
    color: white;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 8px;
    display: block;
}

.stat-label {
    font-size: 16px;
    opacity: 0.9;
    font-weight: 500;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-top: auto;
}

.footer p {
    color: #666;
    margin-bottom: 8px;
}

.footer p:last-child {
    margin-bottom: 0;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .main-card {
        padding: 20px;
    }
    
    .page-title {
        font-size: 28px;
    }
    
    .intro-text {
        font-size: 16px;
    }
    
    .forms-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-category {
        padding: 20px;
    }
    
    .category-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .category-header h3 {
        font-size: 20px;
    }
    
    .logo {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px;
    }
    
    .logo-info h1 {
        font-size: 24px;
    }
    
    .logo-info p {
        font-size: 14px;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .stat-number {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .logo-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .category-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .form-link {
        padding: 12px 15px;
    }
    
    .form-link i {
        font-size: 16px;
    }
    
    .form-link span {
        font-size: 14px;
    }
}

/* Animation for page load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-card {
    animation: fadeInUp 0.6s ease-out;
}

.form-category {
    animation: fadeInUp 0.6s ease-out;
}

.form-category:nth-child(1) { animation-delay: 0.1s; }
.form-category:nth-child(2) { animation-delay: 0.2s; }
.form-category:nth-child(3) { animation-delay: 0.3s; }
.form-category:nth-child(4) { animation-delay: 0.4s; }
.form-category:nth-child(5) { animation-delay: 0.5s; }
.form-category:nth-child(6) { animation-delay: 0.6s; }

/* Focus styles for accessibility */
.form-link:focus {
    outline: 3px solid #1976d2;
    outline-offset: 2px;
}

/* Loading Overlay Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-container {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.5s ease-out;
}

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

.loading-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    background: linear-gradient(135deg, #1976d2, #42a5f5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 36px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.loading-content h3 {
    color: #1976d2;
    font-size: 24px;
    margin-bottom: 15px;
    font-weight: 600;
}

.loading-content p {
    color: #666;
    font-size: 16px;
    margin-bottom: 30px;
    min-height: 20px;
}

.loading-progress {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1976d2, #42a5f5);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    color: #1976d2;
    font-weight: bold;
    font-size: 14px;
}

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.step {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    opacity: 0.5;
}

.step.active {
    background: #e3f2fd;
    color: #1976d2;
    opacity: 1;
    transform: translateX(5px);
}

.step.completed {
    background: #e8f5e8;
    color: #2e7d32;
    opacity: 1;
}

.step i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.step span {
    font-size: 14px;
    font-weight: 500;
}

/* Portal-specific colors */
.loading-overlay[data-portal="aia"] .loading-logo {
    background: linear-gradient(135deg, #e91e63, #f06292);
}

.loading-overlay[data-portal="akpk"] .loading-logo {
    background: linear-gradient(135deg, #4caf50, #81c784);
}

.loading-overlay[data-portal="ibft"] .loading-logo {
    background: linear-gradient(135deg, #ff9800, #ffb74d);
}

.loading-overlay[data-portal="invoice"] .loading-logo {
    background: linear-gradient(135deg, #9c27b0, #ba68c8);
}

.loading-overlay[data-portal="pidm"] .loading-logo {
    background: linear-gradient(135deg, #2196f3, #64b5f6);
}

.loading-overlay[data-portal="sst"] .loading-logo {
    background: linear-gradient(135deg, #f44336, #ef5350);
}

/* Responsive loading overlay */
@media (max-width: 768px) {
    .loading-container {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .loading-logo {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .loading-content h3 {
        font-size: 20px;
    }
    
    .loading-content p {
        font-size: 14px;
    }
    
    .step {
        padding: 10px 15px;
    }
    
    .step i {
        font-size: 16px;
    }
    
    .step span {
        font-size: 13px;
    }
}

/* Print styles */
@media print {
    .container {
        background: white;
    }
    
    .main-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .form-category {
        break-inside: avoid;
        margin-bottom: 20px;
    }
    
    .loading-overlay {
        display: none !important;
    }
}
