* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Tajawal', sans-serif;
}

body {
    background: #f8fbfd;
    line-height: 1.6;
}

.header {
    background: linear-gradient(135deg, #008080, #006666);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}


.container {
    max-width: 1300px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.models-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 0; 
}

.model-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,128,128,0.2);
    transition: transform 0.3s;
    position: relative;
    text-align: center;
    width: calc(100% - 2rem); 
    max-width: 340px;
    min-width: 260px;
    flex: 1 1 calc(33.333% - 2rem);
}

.model-card:hover {
    transform: translateY(-5px);
}

.model-badge {
    position: absolute;
    top: -10px;
    left: -10px;
    background: #ffa500;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
}

.model-card h3 {
    margin-top: 1rem;
    font-size: 1.4rem;
    color: #008080;
}

.model-details {
    margin: 1rem 0;
    color: #445;
}

.model-details p {
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.view-btn {
    padding: 0.8rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    background: #008080;
    color: white;
    transition: transform 0.2s;
}

.view-btn:hover {
    background: #006666;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .models-grid {
        grid-template-columns: 1fr;
    }

    .model-card {
        padding: 1rem;
    }
}

.icon {
    font-size: 1.2rem;
    vertical-align: middle;
}

.year-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #009688;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
}

.version-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.version-btn {
    padding: 0.8rem;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    display: block;
    position: relative;
}

.version-btn:hover {
    transform: translateY(-2px);
}

.unsolved-btn {
    background: #008080;
    color: white;
    border: 2px solid #006666;
}

.solved-btn {
    background: #4CAF50;
    color: white;
    border: 2px solid #388E3C;
}

.version-btn.disabled {
    background: #cccccc;
    color: #666666;
    cursor: not-allowed;
    border: 2px solid #999999;
}

.file-size {
    display: block;
    font-size: 0.8rem;
    opacity: 0.9;
    margin-top: 0.3rem;
}

.model-card {
    padding: 2rem 1.5rem;
    min-height: 220px;
}

.model-card h3 {
    margin: 1rem 0;
    font-size: 1.6rem;
}

@media (max-width: 768px) {
    .version-buttons {
        flex-direction: column;
    }
    
    .model-card {
        padding: 1.5rem 1rem;
    }
}


.important-notes {
    background: #fff9e6;
    border-left: 4px solid #ffa500;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    color: #664d00;
}

.ad {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.error-container {
    text-align: center;
    padding: 2rem;
}

.error-box {
    background: white;
    padding: 3rem 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 128, 128, 0.2);
    max-width: 450px;
    margin: auto;
    animation: fadeIn 0.7s ease-in-out;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-box h1 {
    font-size: 5rem;
    color: #008080;
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.2rem;
    color: #444;
    margin-bottom: 2rem;
}

.home-btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: #008080;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: background 0.3s ease, transform 0.2s;
}

.home-btn:hover {
    background: #006666;
    transform: translateY(-2px);
}

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

@media (max-width: 480px) {
    .error-box h1 {
        font-size: 3.5rem;
    }

    .error-message {
        font-size: 1rem;
    }

    .home-btn {
        width: 100%;
    }
}

body.error-404 {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #f0fafa, #e0f7f7);
    direction: rtl;
    text-align: center;
    padding: 1rem;
}

.telegram-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #0088cc;
    color: #fff;
    border-radius: 30px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    font-size: 16px;
    text-decoration: none;
    transition: background-color 0.3s ease;
    z-index: 1000;
}

.telegram-button:hover {
    background-color: #007ab8;
}

.telegram-button svg {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    fill: white;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #D32F2F;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    width: 100%;
    margin-top: 30px; 
    margin-bottom: 50px;
  }
.download-btn svg {
    padding-left: 5px;
    width: 24px;
    height: 24px;
    margin-right: 8px;
}

#pdf, .download-btn {
    max-width: 600px;
}

#pdf {
    width: 100%;
    max-width: 900px;
    height: 75vh;
    border: none;
    display: block;
    margin: auto;
    overflow-x: hidden;
    overflow-y: auto;
    transform-origin: center center;
    display: block;
    margin: 0 auto;
}

@media (max-width: 768px){
    #pdf {
        height: 65vh;
    }
}

a {
    cursor: pointer;
}