/* تنسيقات عامة */
:root {
    --primary-color: #00bcd4;
    --text-color: #333;
    --background-color: #f8f9fa;
    --border-color: #e9ecef;
    --shadow-color: rgba(0, 0, 0, 0.05);
}

@font-face {
    font-family: 'Alexandria';
    src: url('fontsarabic/Alexandria-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
}

body {
    font-family: 'Alexandria', sans-serif;
    margin: 0;
    padding: 0;
    background: url('../images/background.jpg') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
}

/* تنسيقات الهيدر */
.main-header {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
    font-size: 1.5rem;
}

.logo img {
    max-height: 50px;
    width: auto;
}

.main-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(0, 188, 212, 0.1);
    color: var(--primary-color);
}

/* تنسيقات عامة للمحتوى */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.content-box {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* تنسيقات النماذج */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: 'Alexandria', sans-serif;
    font-size: 1rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1);
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-family: 'Alexandria', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #0097a7;
    transform: translateY(-1px);
}

/* تنسيقات الرسائل */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* تجاوب مع الشاشات الصغيرة */
@media (max-width: 768px) {
    .header-container {
        padding: 0 0.5rem;
    }
    
    .main-nav {
        gap: 1rem;
    }
    
    .nav-link {
        padding: 0.5rem;
    }
    
    .container {
        padding: 0 0.5rem;
    }
    
    .content-box {
        padding: 1.5rem;
    }
}

/* تنسيقات خاصة بالصفحة الرئيسية */
.card-creator {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

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

.templates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.template-item {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.template-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.template-item.selected {
    border-color: var(--primary-color);
    animation: pulse 2s infinite;
}

.template-item img {
    width: 100%;
    height: auto;
    border-radius: 7px;
    transition: transform 0.3s ease;
}

.template-item:hover img {
    transform: scale(1.05);
}

.name-input {
    text-align: center;
    margin-top: 2rem;
}

.arabic-input {
    width: 100%;
    max-width: 400px;
    padding: 1rem 1.5rem;
    font-size: 1.2rem;
    font-family: var(--font-family);
    border: 2px solid #ddd;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.arabic-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.2);
    outline: none;
}

.card-preview {
    margin-top: 3rem;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.preview-image {
    margin-bottom: 2rem;
}

.preview-image img {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 188, 212, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 188, 212, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 188, 212, 0);
    }
}

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

/* تحسينات للأجهزة المحمولة */
@media (max-width: 768px) {
    .container {
        padding: var(--spacing);
        margin: 1rem;
    }
    
    .site-title {
        font-size: 2rem;
    }
    
    .card-creator {
        padding: 1rem;
    }
    
    .templates {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .nav-buttons {
        flex-direction: column;
        gap: 1rem;
    }
}
