:root {
    --primary-color: #5a5041;
    --secondary-color: #fce1b8;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --bg-color: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* Header Styles */
header {
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

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

.logo img {
    height: 40px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    margin: 0 1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--secondary-color);
}

/* Hero Section */
.hero {
    display: none;
}

/* Adjust main content spacing since hero is removed */
main {
    padding-top: 70px; /* Add padding to account for fixed header */
}

/* Adjust generator section to be more prominent now that it's the main focus */
.generator-section {
    padding-top: 100px;
    padding-bottom: 80px;
    background-color: var(--bg-color);
    min-height: calc(100vh - 70px - 200px); /* Viewport height minus header and footer */
}

/* Center the generator section better */
.container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* No need for the cta-button in the hero section, but keep it for consistency */
.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: #d9cdb0;
    color: var(--white);
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.cta-button:hover {
    background-color: #c4b69a;
}

/* Features Section */
.features {
    padding: 5rem 2rem;
    background-color: var(--light-bg);
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--primary-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

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

.feature-card i {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Generator Section */
.form-container {
    position: relative;
    background-image: url('backgroundh.jpg');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    padding: 15rem 2rem 2rem;
    padding-top: 20px;
    padding-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    overflow: hidden;
    min-height: 1000px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.form-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.form-group {
    margin-bottom: 1.5rem;
}

/* Gender Section with Template Preview */
.gender-section {
    position: relative;
    margin: 1.5rem 0;
}

.gender-inputs {
    width: 100%;
    padding-left: 20px;
}

.template-preview {
    position: absolute;
    left: 20px;
    top: 120%;
    transform: translateY(-50%);
    width: 250px;
    pointer-events: none;
    z-index: 1;
}

.preview-image {
    width: 100%;
    height: auto;
    opacity: 0.8;
    margin-right: 400px;
}

.radio-group {
    display: flex;
    align-items: center;
    margin-top: 5px;
}

.radio-group input[type="radio"] {
    margin: 0 5px;
}

.radio-group label {
    color: var(--primary-color);
    font-weight: 500;
    
    margin-left: 30px;
}

/* Add space for the last radio option */
.radio-group label:last-child {
    
    margin-left: 30px;
}

/* Gender section label */
.gender-inputs > label {
    display: block;
    margin-bottom: 5px;
}

button[type="submit"] {
    background-color: #c61716;
    color: var(--white);
    padding: 1rem 2rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s ease;
    width: 100%;
    margin-bottom: 8rem;
}

button[type="submit"]:hover {
    background-color: #c61716;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 3rem 2rem 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section h3 {
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--white);
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Language Toggle */
.language-toggle button {
    background: none;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-toggle button:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}

/* Responsive Design */
@media (max-width: 992px) {
    main {
        padding-top: 60px;
    }
    
    .form-container {
        flex-direction: column;
        padding: 8rem 2rem 2rem;
    }
    
    .form-images {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .template-preview {
        width: 220px;
    }
    
     {
        font-size: 26px;
        padding-top: 150px;
    }
    
     span {
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    main {
        padding-top: 50px;
    }
    
    .nav-links {
        display: none;
    }
    
    .form-container {
        padding: 2rem;
        min-height: auto;
        background-size: cover;
        background-position: center;
        background-image: url('backgroundh2.jpg'); /* Change background image for responsive mode */
    }
    
    .form-images {
        grid-template-columns: 1fr;
    }

    .gender-section {
        margin: 2rem 0;
    }

    .template-preview {
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        transform: none;
        width: 100%;
        max-width: 300px;
        margin: 1rem auto;
        display: none; /* Hide the preview on mobile */
    }

    .gender-inputs {
        width: 100%;
        padding-left: 0;
        margin-bottom: 1rem;
    }
    
     {
        font-size: 22px;
        padding-top: 120px;
    }
    
     span {
        font-size: 20px;
    }
    
    button[type="submit"] {
        width: 100%;
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .generator-section {
        padding: 4rem 1rem;
    }
    
    .container {
        padding: 0 1rem;
    }

    .radio-group {
        display: flex;
        justify-content: center;
        gap: 2rem;
    }

    .radio-group label {
        margin: 0;
    }

    #certificatePreview {
        margin-top: 2rem;
        padding: 1rem;
    }

    #certificateContainer {
        margin: 1rem 0;
        padding: 0;
    }

    #certificateContainer canvas {
        max-width: 100%;
        height: auto !important;
        margin: 0 auto;
    }

    .form-group {
        margin-bottom: 1.5rem;
    }

    input[type="text"] {
        padding: 0.8rem;
        font-size: 1rem;
    }

    button[type="submit"] {
        width: 100%;
        padding: 1rem;
        margin-top: 1rem;
    }

    #downloadCertificate {
        width: 100%;
        padding: 1rem;
        margin-top: 1rem;
    }
}

@media (max-width: 576px) {
    main {
        padding-top: 40px;
    }
    
    .cta-button {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .form-container {
        padding: 6rem 1rem 1rem;
        min-height: 700px;
    }
    
     {
        font-size: 20px;
        padding-top: 80px;
    }
    
     span {
        font-size: 18px;
    }
    
    .title-decoration {
        margin-bottom: 2rem;
    }
    
    input[type="text"] {
        padding: 0.8rem;
    }
    
    .gender-inputs > label {
        margin-bottom: 8px;
    }
    
    .radio-group {
        flex-wrap: wrap;
    }
    
    .radio-group label {
        margin-bottom: 10px;
    }
    
    button[type="submit"] {
        padding: 0.8rem 1.5rem;
        margin-bottom: 3rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .footer-section {
        text-align: center;
        margin-bottom: 2rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .gender-inputs {
        padding-left: 10px;
    }
    
    .generator-section {
        padding-top: 30px;
    }
}

@media (max-width: 380px) {
    .form-container {
        padding: 3rem 0.8rem 1rem;
    }
    
    .title-decoration h2 {
        font-size: 18px;
        padding-top: 60px;
    }
    
    .title-decoration h2 span {
        font-size: 16px;
    }
}

/* Certificate Preview */
#certificatePreview {
    margin-top: 2rem;
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    text-align: center;
}

#certificatePreview.hidden {
    display: none;
}

#certificateContainer {
    max-width: 100%;
    overflow-x: auto;
    margin: 1rem 0;
    text-align: center;
}

#certificateContainer canvas {
    max-width: 100%;
    height: auto !important;
    margin: 0 auto;
}

#downloadCertificate {
    display: block;
    margin: 1rem auto;
    background-color: var(--accent-color);
    color: var(--white);
    padding: 1rem 2rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

#downloadCertificate:hover {
    background-color: #c0392b;
}

/* Remove the Features section as it's no longer needed */
.features, .features-grid, .feature-card {
    display: none;
}

/* Title Decoration */
.title-decoration {
    position: relative;
    margin-bottom: 3.5rem;
    text-align: center;
    padding-top: 30px;
}

.title-decoration h2 {
    color: #c61716;
    font-size: 32px;
    margin-bottom: 1.5rem;
    padding-top: 190px;
    line-height: 1.4;
}

.title-decoration h2 span {
    color: #c61716;
    font-size: 32px;
    font-weight: 700;
    display: inline-block;
    position: relative;
}

.title-decoration h2 span::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #c61716;
}

/* Bottom Right Decoration */
.bottom-right-image {
    display: none;
}

/* Add space between labels and text inputs only */
label[for="fullName"], label[for="signature"] {
    display: block;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-weight: 1900;
    font-style: bold;
}

/* Base label styling */
label {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 500;
}

/* Form elements RTL support */
input[type="text"] {
    text-align: right;
    padding: 0.8rem 1rem;
    width: 100%;
    border: 2px solid var(--primary-color);
    border-radius: 5px;
    font-size: 1rem;
    background-color: rgba(255, 255, 255, 0.9);
    transition: border-color 0.3s ease;
    direction: rtl;
}

input[type="text"]::placeholder {
    color: #666;
}

input[type="text"]:focus {
    outline: none;
    border-color: #124e3d;
    background-color: #fddeb5;
}

/* RTL specific adjustments */
[dir="rtl"] .form-container {
    text-align: right;
}

[dir="rtl"] .radio-group {
    justify-content: flex-start;
}

[dir="rtl"] .radio-group label {
    margin-right: 5px;
    margin-left: 20px;
}

[dir="rtl"] .template-preview {
    right: 20px;
    left: auto;
}

/* Additional mobile optimizations */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .form-container {
        padding: 1.5rem;
    }

    .title-decoration h2 {
        font-size: 1.5rem;
        line-height: 1.4;
    }
}

/* Enhanced cropper modal styles for better UX */
.cropper-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.92); /* Even darker background */
    z-index: 2000;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 20px;
    transition: opacity 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(5px); /* Add blur effect to background */
}

.cropper-container {
    background-color: #fff;
    border-radius: 12px;
    padding: 30px;
    width: 95%;
    max-width: 800px; /* Larger container */
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); /* More dramatic shadow */
    border: 3px solid #188995;
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    direction: ltr;
}

.cropper-container h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #188995;
    font-size: 26px;
    font-weight: bold;
    position: relative;
    padding-bottom: 15px;
}

.cropper-container h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #188995;
    border-radius: 3px;
}

.image-container {
    width: 100%;
    height: 470px;
    margin-bottom: 30px;
    overflow: hidden;
    border: 2px solid #eaeaea;
    border-radius: 8px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
    background-color: #f8f8f8;
    position: relative;
}

.image-container::before {
    content: 'جاري التحميل...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #888;
    font-size: 18px;
}

#cropperImage {
    max-width: 100%;
    max-height: 100%;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#cropperImage.loaded {
    opacity: 1;
}

/* Cropper controls */
.cropper-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.cropper-control-btn {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cropper-control-btn:hover {
    background-color: #e9e9e9;
    transform: translateY(-2px);
}

.cropper-control-btn i {
    margin-right: 5px;
}

/* Action buttons */
.cropper-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
}

.cropper-actions .cta-button, 
.cropper-actions .secondary-button {
    padding: 14px 35px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cropper-actions .cta-button {
    background-color: #188995;
    color: white;
    box-shadow: 0 4px 15px rgba(24, 137, 149, 0.3);
}

.cropper-actions .cta-button:hover {
    background-color: #0e6b76;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(24, 137, 149, 0.4);
}

.cropper-actions .cta-button:active {
    transform: translateY(-1px);
}

.cropper-actions .secondary-button {
    background-color: #f2f2f2;
    color: #333;
    border: 1px solid #ddd;
}

.cropper-actions .secondary-button:hover {
    background-color: #e6e6e6;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cropper-actions .cta-button i,
.cropper-actions .secondary-button i {
    margin-right: 8px;
    font-size: 18px;
}

/* Enhanced Cropper.js styles */
.cropper-view-box,
.cropper-face {
    border-radius: 50%;
    outline: 3px solid rgba(24, 137, 149, 0.7);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.cropper-point,
.cropper-line {
    background-color: #188995;
    opacity: 0.9;
}

.cropper-point {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: white;
    border: 2px solid #188995;
}

.cropper-point.point-e,
.cropper-point.point-w,
.cropper-point.point-n,
.cropper-point.point-s {
    opacity: 1;
}

.cropper-dashed {
    border-color: rgba(255, 255, 255, 0.5);
}

/* Device-specific tweaks */
@media (max-width: 768px) {
    .cropper-container {
        padding: 20px;
        width: 95%;
        border-width: 2px;
    }
    
    .image-container {
        height: 350px;
    }
    
    .cropper-actions .cta-button,
    .cropper-actions .secondary-button {
        padding: 12px 25px;
        font-size: 15px;
    }
    
    .cropper-container h3 {
        font-size: 22px;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .image-container {
        height: 280px;
    }
    
    .cropper-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .cropper-actions .cta-button,
    .cropper-actions .secondary-button {
        width: 100%;
    }
    
    .cropper-controls {
        gap: 8px;
    }
    
    .cropper-control-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* Add back the file upload and cropped preview styles */
.cropped-preview {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    transition: all 0.3s ease;
}

.cropped-preview img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #188995;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

/* Make sure the preview info message is hidden if it exists */
.preview-info {
    display: none;
}

/* Make sure the cropper container direction is set */
.cropper-container {
    direction: ltr;
}

/* File input styles */
input[type="file"] {
    display: none;
}

/* Enhanced file upload label styles */
.file-upload-label {
    display: block;
    padding: 15px;
    background-color: #f0f7f7;
    border: 2px dashed #188995;
    border-radius: 6px;
    text-align: center;
    color: #188995;
    font-weight: bold;
    margin-top: 10px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.file-upload-label:hover {
    background-color: #e0f2f3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.file-upload-label:active {
    transform: translateY(0);
}

/* Add an icon to make it more intuitive */
.file-upload-label::before {
    content: '\f093';
    font-family: 'Font Awesome 5 Free';
    margin-right: 10px;
    font-size: 16px;
}

/* Also add back the generator section responsiveness */
@media (max-width: 992px) {
    .generator-section {
        padding-top: 80px;
    }
    
    .title-decoration h2 {
        font-size: 20px;
        padding-top: 120px;
    }
    
    .title-decoration h2 span {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .generator-section {
        padding-top: 60px;
        padding-bottom: 60px;
    }
    
    .title-decoration {
        margin-bottom: 2.5rem;
    }
}

@media (max-width: 576px) {
    .generator-section {
        padding-top: 40px;
        padding-bottom: 40px;
    }
    
    .title-decoration {
        padding-top: 20px;
    }
}

/* Analytics Dashboard */
.analytics-toggle {
    text-align: center;
    color: #188995;
    padding: 10px;
    margin-top: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.analytics-toggle:hover {
    color: #c61716;
}

.analytics-dashboard {
    background-color: #f8f8f8;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.analytics-dashboard h3 {
    color: #188995;
    font-size: 18px;
    margin-bottom: 10px;
    text-align: center;
}

.analytics-dashboard ul {
    list-style: none;
    padding: 0;
}

.analytics-dashboard li {
    padding: 5px 0;
    text-align: center;
    font-size: 16px;
}

.analytics-dashboard li span {
    font-weight: bold;
    color: #065e69;
}


