/* Download Page Styles - Academic Layout */

/* Banner Section */
.download-banner {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.banner-image {
    position: relative;
    width: 100%;
    height: 100%;
}

.banner-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Main Layout */
.download-main {
    min-height: calc(100vh - 320px);
    padding: 0;
    background: #f5f5f5;
}

/* Download Layout */
.download-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: calc(100vh - 120px);
}

/* Left Sidebar */
.download-sidebar {
    background: #00773f;
    color: white;
    padding: 0;
    position: relative;
}

.sidebar-header {
    background: #005530;
    padding: 2rem;
    text-align: center;
}

.sidebar-header h3 {
    color: white;
    font-size: 1.5rem;
    margin: 0;
    font-weight: bold;
}

.sidebar-menu {
    padding: 1rem 0;
}

.menu-item {
    display: block;
    padding: 1rem 2rem;
    color: rgba(255,255,255,0.9);
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 0.95rem;
}

.menu-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    padding-left: 2.5rem;
}

.menu-item.active {
    background: #005530;
    color: white;
    font-weight: bold;
    border-left: 4px solid white;
}

/* Right Content Area */
.download-content {
    background: white;
    padding: 2rem;
    overflow-y: auto;
}

.content-category {
    display: none;
    animation: fadeInUp 0.4s ease-out;
}

.content-category.active {
    display: block;
}

.category-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.category-header h2 {
    color: #00773f;
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
    font-weight: bold;
}

.category-header p {
    color: #666;
    font-size: 1rem;
    margin: 0;
    line-height: 1.6;
}

/* Download Grid */
.download-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Download Item */
.download-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.download-item:hover {
    border-color: #00773f;
    box-shadow: 0 6px 20px rgba(0,119,63,0.1);
    transform: translateY(-2px);
}

.download-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #00773f;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s ease;
}

.download-item:hover::before {
    transform: scaleY(1);
}

/* Item Icon - Removed */

/* Item Info */
.item-info {
    flex: 1;
    min-width: 0;
}

.item-info h4 {
    color: #333;
    font-size: 1.3rem;
    margin: 0 0 0.5rem 0;
    font-weight: bold;
    line-height: 1.3;
}

.item-info p {
    color: #666;
    font-size: 0.95rem;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.item-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.item-meta span {
    background: #f8f9fa;
    color: #495057;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.file-size {
    background: #e3f2fd !important;
    color: #1976d2 !important;
}

.file-type {
    background: #f3e5f5 !important;
    color: #7b1fa2 !important;
}

.update-date {
    background: #e8f5e8 !important;
    color: #2e7d32 !important;
}

/* Item Actions */
.item-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

.download-btn {
    background: #00773f;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    min-width: 120px;
    justify-content: center;
}

.download-btn:hover {
    background: #005530;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,119,63,0.2);
}

.download-btn.secondary {
    background: #6c757d;
}

.download-btn.secondary:hover {
    background: #5a6268;
}

.preview-btn {
    background: transparent;
    color: #00773f;
    border: 1px solid #00773f;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    min-width: 120px;
    justify-content: center;
}

.preview-btn:hover {
    background: #00773f;
    color: white;
}

/* Version Timeline */
.version-timeline {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.version-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: relative;
}

.version-item::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 2rem;
    width: 16px;
    height: 16px;
    background: #00773f;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 3px #e9ecef;
}

.version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.version-header h4 {
    color: #00773f;
    font-size: 1.4rem;
    margin: 0;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.badge {
    background: #28a745;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge.latest {
    background: #dc3545;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.version-date {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: normal;
}

.version-content h5 {
    color: #333;
    font-size: 1.1rem;
    margin: 0 0 1rem 0;
    font-weight: 600;
}

.version-content ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.version-content li {
    padding: 0.3rem 0;
    position: relative;
    padding-left: 1.5rem;
    color: #333;
    line-height: 1.5;
}

.version-content li:before {
    content: "▶";
    position: absolute;
    left: 0;
    color: #00773f;
    font-size: 0.8rem;
}

.version-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.changelog-btn {
    background: transparent;
    color: #6c757d;
    border: 1px solid #6c757d;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.changelog-btn:hover {
    background: #6c757d;
    color: white;
}

/* Active Navigation Link */
.nav-links a.active {
    background-color: rgba(255,255,255,0.2);
    color: white;
}

/* Download Modal */
.download-modal,
.progress-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.download-modal.active,
.progress-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

.modal-header {
    background: #00773f;
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: rgba(255,255,255,0.2);
}

.modal-body {
    padding: 2rem;
}

.download-info {
    margin-bottom: 2rem;
}

.file-details h4 {
    color: #333;
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.file-details p {
    color: #666;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.file-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.download-terms {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #333;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #00773f;
    border-color: #00773f;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: "✓";
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.modal-footer {
    background: #f8f9fa;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn.primary {
    background: #00773f;
    color: white;
}

.btn.primary:hover:not(:disabled) {
    background: #005530;
}

.btn.primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn.secondary {
    background: #6c757d;
    color: white;
}

.btn.secondary:hover {
    background: #5a6268;
}

/* Progress Modal */
.progress-info {
    text-align: center;
}

.progress-info h4 {
    color: #333;
    margin: 0 0 2rem 0;
    font-size: 1.2rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00773f, #28a745);
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(45deg, 
        transparent 35%, 
        rgba(255,255,255,0.2) 35%, 
        rgba(255,255,255,0.2) 65%, 
        transparent 65%);
    background-size: 10px 10px;
    animation: progressStripes 1s linear infinite;
}

@keyframes progressStripes {
    0% { background-position: 0 0; }
    100% { background-position: 10px 0; }
}

.progress-text {
    display: flex;
    justify-content: space-between;
    color: #666;
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .download-banner {
        height: 180px;
    }
    
    .download-main {
        min-height: calc(100vh - 300px);
    }
    
    .download-layout {
        grid-template-columns: 220px 1fr;
    }
    
    .sidebar-header {
        padding: 1.2rem 1.5rem;
    }
    
    .menu-item {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .menu-item:hover {
        padding-left: 2rem;
    }
    
    .download-content {
        padding: 1.5rem;
    }
    
    .category-header h2 {
        font-size: 1.8rem;
    }
    
    .download-item {
        flex-direction: column;
        text-align: left;
        gap: 1rem;
    }
    
    .item-actions {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .download-banner {
        height: 150px;
    }
    
    .download-main {
        min-height: calc(100vh - 270px);
    }
    
    .download-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .download-sidebar {
        position: relative;
        height: auto;
    }
    
    .sidebar-header {
        padding: 1rem 1.5rem;
    }
    
    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        padding: 0.5rem 0;
        white-space: nowrap;
    }
    
    .menu-item {
        flex: 0 0 auto;
        padding: 0.8rem 1.5rem;
        border-bottom: none;
        border-right: 1px solid rgba(255,255,255,0.1);
        white-space: nowrap;
        font-size: 0.9rem;
    }
    
    .menu-item:hover {
        padding-left: 1.5rem;
    }
    
    .menu-item.active {
        border-right: 1px solid rgba(255,255,255,0.1);
        border-bottom: 3px solid white;
        border-left: none;
    }
    
    .download-content {
        padding: 1rem 1.5rem;
    }
    
    .category-header h2 {
        font-size: 1.6rem;
    }
    
    .download-item {
        padding: 1.2rem;
    }
    
    
    .item-info h4 {
        font-size: 1.2rem;
    }
    
    .item-meta {
        justify-content: center;
    }
    
    .version-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .version-actions {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem 1.5rem;
    }
    
}

@media (max-width: 480px) {
    .sidebar-header h3 {
        font-size: 1.1rem;
    }
    
    .menu-item {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }
    
    .category-header h2 {
        font-size: 1.4rem;
    }
    
    .download-content {
        padding: 1rem;
    }
    
    .download-item {
        padding: 1rem;
    }
    
    
    .item-info h4 {
        font-size: 1.1rem;
    }
    
    .item-info p {
        font-size: 0.9rem;
    }
    
    .download-btn,
    .preview-btn {
        min-width: 100px;
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    .version-item {
        padding: 1rem;
    }
    
    .version-header h4 {
        font-size: 1.2rem;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .file-details h4 {
        font-size: 1.1rem;
    }
}

/* Focus States for Accessibility */
.menu-item:focus,
.download-btn:focus,
.preview-btn:focus,
.btn:focus {
    outline: 2px solid rgba(0,119,63,0.8);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .download-sidebar,
    .item-actions,
    .version-actions {
        display: none;
    }
    
    .download-layout {
        grid-template-columns: 1fr;
    }
    
    .content-category {
        display: block !important;
        page-break-inside: avoid;
        margin-bottom: 2rem;
    }
    
    .download-item,
    .version-item {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}