* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: rgb(255, 255, 255);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    position: relative;
}

h1 {
    text-align: left;
    margin-bottom: 30px;
    font-size: 2.5em;
}

#title-prefix {
    color: #3498db; /* Sets a fixed blue color for #OPENTO */
}

#title-suffix {
    color: #e7a33c; /* Sets a fixed orange color for the dynamic part */
}

/* Introduction Section Styles */
.intro-section {
    margin: 40px 0;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    border: 2px solid #dee2e6;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.subtitle {
    font-size: 1.8em;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 600;
    background: linear-gradient(45deg, #3498db, #9b59b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.intro-text {
    font-size: 1.1em;
    color: #34495e;
    line-height: 1.6;
    margin-bottom: 25px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.feature-highlights {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.feature-tag {
    background: transparent;
    color: #3498db;
    border: 1px solid #3498db;
    padding: 8px 10px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: 500;
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
    display: inline-block;
    border: none;
}

.feature-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.preview-container {
    margin: 20px 0;
    text-align: center;
}

.preview-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.preview-image:hover {
    transform: scale(1.02);
}

.clickable-image {
    cursor: pointer;
    border: 3px dashed #3498db;
    transition: all 0.3s ease;
}

.clickable-image:hover {
    border-color: #2980b9;
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(52, 152, 219, 0.3);
}

.upload-hint {
    margin-top: 10px;
    color: #7f8c8d;
    font-size: 14px;
    font-style: italic;
}

.image-container {
    position: relative;
    display: inline-block;
}

.crop-overlay-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, rgba(237, 227, 212, 0.7), rgba(245, 219, 197, 0.7));
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(238, 205, 152, 0.4);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crop-overlay-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(238, 205, 152, 0.4);
}

.crop-overlay-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.input-section {
    margin: 30px 0;
}

.input-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
}

.text-editor {
    background: #44712e;
    border-radius: 10px;
    border: 2px solid #e1e8ed;
    transition: all 0.3s ease;
    min-height: 50px;
}

.text-editor:focus-within {
    border-color: #3498db;
    background: #44712e;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Quill editor specific styles */
.ql-toolbar {
    border-top: 2px solid #e1e8ed;
    border-left: 2px solid #e1e8ed;
    border-right: 2px solid #e1e8ed;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    background: #ffffff;
    padding: 8px 12px;
}

.ql-container {
    border-bottom: 2px solid #e1e8ed;
    border-left: 2px solid #e1e8ed;
    border-right: 2px solid #e1e8ed;
    border-top: none;
    border-radius: 0 0 10px 10px;
    font-size: 16px;
    background: #44712e;
}

.ql-editor {
    min-height: 40px;
    padding: 12px 16px;
    color: white;
    background: #44712e;
}

/* Ensure all text in editor defaults to white */
.ql-editor * {
    color: white;
}

.ql-editor.ql-blank::before {
    color: #B3D9FF;
    font-style: italic;
}

/* Placeholder styling for fallback input */
#fallback-text-input::placeholder {
    color: #B3D9FF;
    opacity: 0.8;
}

/* Fallback input styling */
.fallback-text-input {
    transition: background-color 0.3s ease;
}

.fallback-text-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Focus state for editor */
.text-editor:focus-within .ql-toolbar {
    border-color: #3498db;
}

.text-editor:focus-within .ql-container {
    border-color: #3498db;
    background: #44712e;
}

/* Font size buttons */
.font-size-btn {
    background: #f8f9fa !important;
    color: #495057 !important;
    border: 1px solid #dee2e6 !important;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 2px;
    font-weight: 500;
    box-sizing: border-box;
}

.font-size-btn:hover {
    background: #e9ecef !important;
    border-color: #adb5bd !important;
    color: #495057 !important;
}

.font-size-btn.active {
    background: #007bff !important;
    color: white !important;
    border-color: #007bff !important;
}

.font-size-btn.active:hover {
    background: #0056b3 !important;
    border-color: #0056b3 !important;
    color: white !important;
}

/* Ensure the button maintains its styles in all states */
#font-size-big-btn {
    background: #f8f9fa !important;
    color: #495057 !important;
    border: 1px solid #dee2e6 !important;
}

#font-size-big-btn.active {
    background: #007bff !important;
    color: white !important;
    border-color: #007bff !important;
}

#font-size-big-btn:hover {
    background: #e9ecef !important;
    color: #495057 !important;
}

#font-size-big-btn.active:hover {
    background: #0056b3 !important;
    color: white !important;
}

.generate-btn {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
    display: inline-block; /* Changed from block */
    vertical-align: middle; /* Ensures vertical alignment with the other button */
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.generate-btn:active {
    transform: translateY(0);
}

.generate-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.result-section {
    margin-top: 30px;
    text-align: center;
}

.result-image {
    max-width: 100%;
    max-height: 600px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.download-btn {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    text-decoration: none;
    display: inline-block;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.crop-btn {
    background: linear-gradient(45deg, #f39c12, #e67e22);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
    text-decoration: none;
    display: inline-block;
    margin: 0 5px;
}

.crop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

.crop-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.error-message {
    color: #e74c3c;
    background: #ffeaea;
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid #e74c3c;
}

.success-message {
    color: #27ae60;
    background: #eafaf1;
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid #27ae60;
}

.inline-icon {
    height: 1.2em; /* Sets the icon height relative to the text size */
    vertical-align: middle; /* Aligns the icon vertically with the text */
    margin: 0 3px; /* Adds a little horizontal space */
}

.inline-text-icon {
    height: 1em; /* Sets height equal to the font-size of the parent text */
    width: auto; /* Maintains the original aspect ratio */
    vertical-align: middle; /* Helps align the icon vertically */
}

.page-logo {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 50px; /* Adjust size as needed */
    height: auto;
}

/* About Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e1e8ed;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.8em;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

.modal-body {
    padding: 30px;
}

.modal-body h3 {
    color: #2c3e50;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.modal-body p {
    color: #34495e;
    line-height: 1.6;
    margin-bottom: 15px;
}

.modal-body ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.modal-body li {
    color: #34495e;
    line-height: 1.6;
    margin-bottom: 10px;
}

.modal-body ol {
    margin-left: 20px;
    margin-bottom: 20px;
}

.modal-body strong {
    color: #2c3e50;
}

.credit-btn {
    background: transparent;
    color: #3498db;
    border: 1px solid #3498db;
    padding: 8px 10px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);;
    font-weight: 500;
    border: none;
}

.credit-btn:hover {
    background: rgba(52, 152, 219, 0.1);
    color: #2980b9;
    border: none;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .intro-section {
        margin: 20px 0;
        padding: 20px;
    }
    
    .subtitle {
        font-size: 1.4em;
    }
    
    .intro-text {
        font-size: 1em;
    }
    
    .feature-highlights {
        gap: 8px;
    }
    
    .feature-tag {
        font-size: 0.8em;
        padding: 6px 12px;
    }
    
    .color-picker-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .color-bar {
        min-width: auto;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-header h2 {
        font-size: 1.5em;
    }
}