/* Utility Classes */
.hidden {
     display: none !important;
}

.visible {
     display: inline-block !important;
}

/* Font Definitions */
@font-face {
     font-family: 'Josefin Sans';
     src: url('public/fonts/JosefinSans.ttf') format('truetype');
}

@font-face {
     font-family: 'Orbitron';
     src: url('public/fonts/Orbitron.ttf') format('truetype');
}

@font-face {
     font-family: 'Concert One';
     src: url('public/fonts/ConcertOne.ttf') format('truetype');
}

@font-face {
     font-family: 'Caveat';
     src: url('public/fonts/Caveat.ttf') format('truetype');
}

@font-face {
     font-family: 'Dancing Script';
     src: url('public/fonts/DancingScript.ttf') format('truetype');
}

@font-face {
     font-family: 'Exo 2';
     src: url('public/fonts/Exo2.ttf') format('truetype');
}

@font-face {
     font-family: 'Goldman';
     src: url('public/fonts/Goldman.ttf') format('truetype');
}

@font-face {
     font-family: 'Indie Flower';
     src: url('public/fonts/IndieFlower.ttf') format('truetype');
}

@font-face {
     font-family: 'League Spartan';
     src: url('public/fonts/LeagueSpartan.ttf') format('truetype');
}

@font-face {
     font-family: 'Lobster Two';
     src: url('public/fonts/LobsterTwo.ttf') format('truetype');
}

@font-face {
     font-family: 'Oleo Script';
     src: url('public/fonts/OleoScript.ttf') format('truetype');
}

@font-face {
     font-family: 'Pacifico';
     src: url('public/fonts/Pacifico.ttf') format('truetype');
}

@font-face {
     font-family: 'Playwrite';
     src: url('public/fonts/Playwrite.ttf') format('truetype');
}

@font-face {
     font-family: 'Sacramento';
     src: url('public/fonts/Sacramento.ttf') format('truetype');
}

@font-face {
     font-family: 'Savate';
     src: url('public/fonts/Savate.ttf') format('truetype');
}

@font-face {
     font-family: 'Unbounded';
     src: url('public/fonts/Unbounded.ttf') format('truetype');
}

/* Quill Custom Font Classes */
.ql-font-josefin-sans {
     font-family: 'Josefin Sans', sans-serif !important;
}

.ql-font-orbitron {
     font-family: 'Orbitron', monospace !important;
}

.ql-font-concert-one {
     font-family: 'Concert One', cursive !important;
}

.ql-font-caveat {
     font-family: 'Caveat', cursive !important;
}

.ql-font-dancing-script {
     font-family: 'Dancing Script', cursive !important;
}

.ql-font-exo-2 {
     font-family: 'Exo 2', sans-serif !important;
}

.ql-font-goldman {
     font-family: 'Goldman', cursive !important;
}

.ql-font-indie-flower {
     font-family: 'Indie Flower', cursive !important;
}

.ql-font-league-spartan {
     font-family: 'League Spartan', sans-serif !important;
}

.ql-font-lobster-two {
     font-family: 'Lobster Two', cursive !important;
}

.ql-font-oleo-script {
     font-family: 'Oleo Script', cursive !important;
}

.ql-font-pacifico {
     font-family: 'Pacifico', cursive !important;
}

.ql-font-playwrite {
     font-family: 'Playwrite', cursive !important;
}

.ql-font-sacramento {
     font-family: 'Sacramento', cursive !important;
}

.ql-font-savate {
     font-family: 'Savate', sans-serif !important;
}

.ql-font-unbounded {
     font-family: 'Unbounded', sans-serif !important;
}

/* Quill Toolbar Font Dropdown Labels */
.ql-picker.ql-font .ql-picker-label[data-value="josefin-sans"]::before,
.ql-picker.ql-font .ql-picker-item[data-value="josefin-sans"]::before {
     content: 'Josefin Sans';
     font-family: 'Josefin Sans', sans-serif;
}

.ql-picker.ql-font .ql-picker-label[data-value="orbitron"]::before,
.ql-picker.ql-font .ql-picker-item[data-value="orbitron"]::before {
     content: 'Orbitron';
     font-family: 'Orbitron', monospace;
}

.ql-picker.ql-font .ql-picker-label[data-value="concert-one"]::before,
.ql-picker.ql-font .ql-picker-item[data-value="concert-one"]::before {
     content: 'Concert One';
     font-family: 'Concert One', cursive;
}

.ql-picker.ql-font .ql-picker-label[data-value="caveat"]::before,
.ql-picker.ql-font .ql-picker-item[data-value="caveat"]::before {
     content: 'Caveat';
     font-family: 'Caveat', cursive;
}

.ql-picker.ql-font .ql-picker-label[data-value="dancing-script"]::before,
.ql-picker.ql-font .ql-picker-item[data-value="dancing-script"]::before {
     content: 'Dancing Script';
     font-family: 'Dancing Script', cursive;
}

.ql-picker.ql-font .ql-picker-label[data-value="exo-2"]::before,
.ql-picker.ql-font .ql-picker-item[data-value="exo-2"]::before {
     content: 'Exo 2';
     font-family: 'Exo 2', sans-serif;
}

.ql-picker.ql-font .ql-picker-label[data-value="goldman"]::before,
.ql-picker.ql-font .ql-picker-item[data-value="goldman"]::before {
     content: 'Goldman';
     font-family: 'Goldman', cursive;
}

.ql-picker.ql-font .ql-picker-label[data-value="indie-flower"]::before,
.ql-picker.ql-font .ql-picker-item[data-value="indie-flower"]::before {
     content: 'Indie Flower';
     font-family: 'Indie Flower', cursive;
}

.ql-picker.ql-font .ql-picker-label[data-value="league-spartan"]::before,
.ql-picker.ql-font .ql-picker-item[data-value="league-spartan"]::before {
     content: 'League Spartan';
     font-family: 'League Spartan', sans-serif;
}

.ql-picker.ql-font .ql-picker-label[data-value="lobster-two"]::before,
.ql-picker.ql-font .ql-picker-item[data-value="lobster-two"]::before {
     content: 'Lobster Two';
     font-family: 'Lobster Two', cursive;
}

.ql-picker.ql-font .ql-picker-label[data-value="oleo-script"]::before,
.ql-picker.ql-font .ql-picker-item[data-value="oleo-script"]::before {
     content: 'Oleo Script';
     font-family: 'Oleo Script', cursive;
}

.ql-picker.ql-font .ql-picker-label[data-value="pacifico"]::before,
.ql-picker.ql-font .ql-picker-item[data-value="pacifico"]::before {
     content: 'Pacifico';
     font-family: 'Pacifico', cursive;
}

.ql-picker.ql-font .ql-picker-label[data-value="playwrite"]::before,
.ql-picker.ql-font .ql-picker-item[data-value="playwrite"]::before {
     content: 'Playwrite';
     font-family: 'Playwrite', cursive;
}

.ql-picker.ql-font .ql-picker-label[data-value="sacramento"]::before,
.ql-picker.ql-font .ql-picker-item[data-value="sacramento"]::before {
     content: 'Sacramento';
     font-family: 'Sacramento', cursive;
}

.ql-picker.ql-font .ql-picker-label[data-value="savate"]::before,
.ql-picker.ql-font .ql-picker-item[data-value="savate"]::before {
     content: 'Savate';
     font-family: 'Savate', sans-serif;
}

.ql-picker.ql-font .ql-picker-label[data-value="unbounded"]::before,
.ql-picker.ql-font .ql-picker-item[data-value="unbounded"]::before {
     content: 'Unbounded';
     font-family: 'Unbounded', sans-serif;
}

* {
     box-sizing: border-box;
}

html,
body {
     font-family: 'Josefin Sans', 'Trebuchet MS', Arial, sans-serif;
     font-size: 18px;
     font-weight: normal;
     background-color: #04695b;
     color: #070704;
     width: 100%;
     max-width: 100%;
     height: auto;
}

h1,
h2,
h3,
h4 {
     font-size: 1.5em;
     line-height: 1.5em;
     font-weight: bold;
     color: #f2f2e5;
     text-shadow: #070704 1px 1px 1px;
     text-align: left;
     margin-top: 5px;
     margin-left: 0.6em;
}


p {
     font-size: 1em;
     line-height: 1.5;
     margin: 10px 0;
     text-wrap: normal;
}

a {
     color: #070704;
}

ol li {
     font-size: 1em;
     line-height: 1.4;
}

.small {
     font-size: 0.5em;
     font-weight: normal;
}

#loading-screen {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background-color: #f0f0f0;
     display: flex;
     justify-content: left;
     align-items: center;
     z-index: 9999;
}

.loader {
     width: 260px;
     height: 45px;
     font-size: 1.4em;
     font-weight: bold;
     color: #070704;
     text-align: left;
     position: relative;
     animation: loading 2s infinite;
}

.logo {
     display: inline-block;
     text-align: left;
     margin: 10px 0 0 15px;
     width: 180px;
     height: auto;
     padding-right: 2.7em;
     border-bottom: 1px solid #fff;
}

.header {
     text-align: left;
     margin-bottom: 5px;
     max-width: 100%;
     max-height: 36px;
}

.main {
     display: flex;
     gap: 10px;
     width: 1199px;
     height: 700px;
     margin: 20px;
     border: #133D4D 1px solid;
     background-color: aliceblue;
}

.main-boxes {
     background-color: #04695b;
     border: 2px solid rgb(51, 51, 51);
     box-shadow: 3px 3px 5px #133D4D;

}

.canvas-container,
.birthday-canvas {
     position: relative;
     flex: 1;
     width: 450px;
     height: 675px;
     max-width: 450px;
     max-height: 675px;
     margin: 1px;
}

canvas {
     width: 100%;
     height: 100%;
     touch-action: none;
     /* Prevent default touch actions like scrolling */
     user-select: none;
     /* Prevent text selection */
     -webkit-user-select: none;
     -moz-user-select: none;
     -ms-user-select: none;
     cursor: grab;
     image-rendering: -webkit-optimize-contrast;
     image-rendering: crisp-edges;
}

canvas:active {
     cursor: grabbing;
}

/* Canvas interaction states */
canvas.resizing {
     cursor: nw-resize !important;
}

canvas.moving {
     cursor: move !important;
}

.controls {
     flex: 1;
     width: 700px;
     height: 675px;
     max-width: 700px;
     max-height: 675px;
     padding: 114px 10px 0 15px;
     border: 2px solid rgb(51, 51, 51);
     margin: 3px 3px 3px 27px;
}

.first-row {
     display: flex;
     gap: 25px;
     max-width: 90%;
     margin-top: 5px;
}

.fonts {
     flex: 1;
     gap: 10px;
     max-width: 36%;
}

.font-size {
     flex: 1;
     gap: 10px;
     max-width: 36%;
}

.font-select {
     font-size: 0.7em;
     font-family: 'Josefin Sans', 'Trebuchet MS', Arial, sans-serif;
     font-weight: bold;
     padding: 2px 5px;
     color: rgb(1, 5, 46);
     border: 1px solid #ccc;
     border-radius: 4px;
     background-color: #fff;
     width: 95%;
     height: 24px;
}

.font-select:focus {
     outline: none;
     border-color: #cb0702;
}

.font-size input[type="range"] {
     width: 100%;
     color: green;
}

.second-row {
     display: flex;
     gap: 32px;
     max-width: 90%;
     margin-top: 25px;
}

.colors {
     flex: 1;
     gap: 10px;
     max-width: 20%;
}

.transparency {
     flex: 1;
     gap: 10px;
     max-width: 45%;
}

label {
     font-family: 'Orbitron', 'Trebuchet MS', Arial, sans-serif;
     font-size: 0.7em;
     color: #fffacd;
     font-weight: bold;
     margin-bottom: 20px;
     text-decoration: underline;
     padding-right: 15px;
}

input[type="range"] {
     appearance: none;
     -webkit-appearance: none;
     border: 1px solid #1d1e25;
     height: 1px;
     background: transparent;
     accent-color: #031d38;
}

.image-upload {
     flex: 1;
     gap: 10px;
     max-width: 45%;
     margin-bottom: 0;
     padding-bottom: 0;
}

#file-upload-button {
     font-size: 0.7em;
     font-weight: bold;
     padding: 5px;
     color: #012003;
     border: 1px solid #ccc;
     border-radius: 4px;
     background-color: #fff;
     cursor: pointer;
     width: 36%;
     height: 27px;
     display: inline-block;
     text-align: center;
     line-height: 27px;
     transition: background-color 0.3s ease;
}

.image-input {
     height: 27px;
     border-radius: 5px;
     padding: 5px;
     font-size: 0.7em;
     font-weight: bold;
}

.custom-image-label {
     display: inline-block;
     font-family: 'Josefin Sans', 'Trebuchet MS', Arial, sans-serif;
     font-size: 0.7rem;
     font-weight: bold;
     color: #333333;
     background-color: #fff;
     border: 1px solid #031d38;
     border-radius: 4px;
     padding: 5px;
     cursor: pointer;
     transition: background-color 0.3s;
     margin-right: 10px;
}

.custom-image-label:hover {
     background-color: #cb0702;
}

.file-name {
     font-family: 'Josefin Sans', 'Trebuchet MS', Arial, sans-serif;
     font-size: 0.7em;
     font-weight: bold;
     color: #333;
     margin-left: 5px;
     overflow: hidden;
}

.image-gallery {
     display: block;
     max-width: 100%;
     overflow-x: auto;
     background-color: #f0f0f0;
     border: 1px solid #ccc;
     border-radius: 5px;
     box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
     white-space: nowrap;
     margin: 5px;
     padding-left: 4px;
     padding-top: 5px;
     justify-content: baseline;
     cursor: pointer;
}

.image-gallery img {
     width: 126px;
     height: auto;
     border-radius: 5px;
     box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
     transition: transform 0.2s ease;
}

.image-gallery img:hover {
     transform: scale(1.05);
     transition: transform 0.3s ease;
}

.image-gallery img:active {
     transform: scale(0.95);
     transition: transform 0.1s ease;
}

.image-gallery img:focus {
     outline: 2px solid #cb0702;
     outline-offset: 2px;
     transition: outline 0.3s ease;
}

.image-gallery img:focus:hover {
     transform: scale(1.05);
     transition: transform 0.3s ease;
}

.image-gallery img:focus:active {
     transform: scale(0.95);
     transition: transform 0.1s ease;
}

.image-gallery img:focus-visible {
     outline: 2px solid #cb0702;
}

.btn {
     padding: 11px 20px;
     border: none;
     border-radius: 6px;
     cursor: pointer;
     font-weight: 600;
     font-size: 14px;
     transition: all 0.2s ease;
     font-family: 'Josefin Sans', 'Trebuchet MS', Arial, sans-serif;
}

.btn-primary {
     background: #FF6B6B;
     color: white;
}

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

.btn-secondary {
     background: #6c757d;
     color: white;
}

.btn-secondary:hover {
     background: #5a6268;
     transform: translateY(-1px);
}

.btn-info {
     background: #17a2b8;
     color: white;
}

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

/* Mobile touch feedback */
@media (hover: none) and (pointer: coarse) {
     .image-gallery img:hover {
          transform: none;
     }

     .image-gallery img:active {
          transform: scale(0.95);
          transition: transform 0.1s ease;
     }
}

/* Dynamic loading enhancements */
.image-gallery img {
     transition: transform 0.2s ease;
}

.image-gallery p {
     font-family: 'Josefin Sans', 'Trebuchet MS', Arial, sans-serif;
     font-size: 0.9em;
     color: #666;
     text-align: center;
     padding: 20px;
     margin: 0;
     white-space: normal;
}

/* Category button enhancements */
.category-btn.active {
     background-color: #cb0702;
     color: white;
     border-color: #fff;
}

/* Batch loading indicators */
@keyframes pulse {
     0% {
          opacity: 0.6;
     }

     50% {
          opacity: 1;
     }

     100% {
          opacity: 0.6;
     }
}

.loading-indicator p {
     font-family: 'Josefin Sans', 'Trebuchet MS', Arial, sans-serif;
     font-size: 0.8em;
     color: #666;
     text-align: center;
     padding: 20px;
     margin: 0;
     white-space: normal;
     animation: pulse 1.5s ease-in-out infinite;
}

.scroll-hint {
     transition: all 0.3s ease;
}

.scroll-hint:hover {
     background-color: #e0e0e0 !important;
     border-color: #999 !important;
     color: #333 !important;
}

.error-indicator p {
     font-family: 'Josefin Sans', 'Trebuchet MS', Arial, sans-serif;
     font-size: 0.8em;
     margin: 0;
     padding: 0;
}

/* Optimize image gallery scrolling */
.image-gallery {
     scroll-behavior: smooth;
     -webkit-overflow-scrolling: touch;
}

.image-gallery img {
     flex-shrink: 0;
     margin-right: 5px;
}

.text-gallery {
     display: flex;
     flex-direction: row;
     gap: 5px;
     height: 150px;
     max-width: 100%;
     overflow-x: auto;
     overflow-y: hidden;
     background-color: #f0f0f0;
     border: 1px solid #ccc;
     border-radius: 5px;
     box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
     padding-left: 4px;
     scroll-behavior: smooth;
     -webkit-overflow-scrolling: touch;
}

.text-gallery p {
     width: 230px;
     height: 140px;
     border-radius: 5px;
     box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
     font-size: 1em;
     font-weight: bold;
     line-height: 1.4em;
     color: #333;
     background-color: #064134;
     text-align: left;
     margin-top: 4px;
     padding: 15px;
     cursor: pointer;
     flex: 0 0 auto;
     text-wrap: auto;
}

/* Text item styling for dynamically loaded texts */
.text-gallery .text-item {
     width: 230px;
     height: 140px;
     border-radius: 5px;
     box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
     font-size: 1em;
     font-weight: bold;
     line-height: 1.1em;
     font-family: 'Oleo Script', Arial, sans-serif;
     color: #f2f2e5;
     background-color: #064134;
     text-align: left;
     margin-top: 4px;
     padding: 15px;
     overflow-y: auto;
     cursor: pointer;
     flex: 0 0 auto;
     transition: background-color 0.2s ease;
}

.text-gallery .text-item:hover {
     background-color: #040223;
}

.how-to-use {
     position: absolute;
     display: inline-block;
     width: 410px;
     height: auto;
     max-width: 90%;
     text-wrap: normal;
     bottom: 74px;
     left: 5px;
}

.how-to-use ol {
     font-size: 0.9em;
     line-height: 1.5em;
     color: #333;
     margin-bottom: 10px;
}

/* Quill Text Editor Styles */
.text-editor {
     position: absolute;
     width: 410px;
     height: 360px;
     background-color: #f2f2e5;
     border: 2px solid #064134;
     border-radius: 9px;
     bottom: 74px;
     left: 18px;
     display: none;
     box-shadow: 0 4px 11px rgba(0, 0, 0, 0.15);
     z-index: 1000;
}

#quill-editor {
     width: 100%;
     height: 300px;
     border: none;
     font-family: 'Oleo Script', Arial, sans-serif;
}

.quill-controls {
     position: absolute;
     bottom: 10px;
     left: 10px;
     right: 10px;
     display: flex;
     gap: 10px;
     justify-content: flex-end;
}

.quill-controls button {
     padding: 7px 14px;
     font-size: 0.7em;
     border-radius: 4px;
     border: none;
     cursor: pointer;
}

#apply-text-btn {
     background-color: #064134;
     color: #f2f2e5;
}

#apply-text-btn:hover {
     background-color: #040223;
}

#cancel-text-btn {
     background-color: #ccc;
     color: #040223;
}

#cancel-text-btn:hover {
     background-color: #0d0b9a;
}

/* Quill Editor Fixed Dimensions for screens 768px and above */
@media screen and (min-width: 768px) {
     .text-editor {
          width: 410px !important;
          height: 360px !important;
     }

     #quill-editor {
          width: 100% !important;
          height: 300px !important;
     }
}

.canvas-controls {
     position: absolute;
     bottom: 15px;
     left: 20px;
     width: 90%;
}

/* Mobile-Only Controls - Simplified without Undo/Redo */
.canvas-controls-mobile {
     position: absolute;
     bottom: 15px;
     left: 20px;
     width: 90%;
     display: none;
     /* Hidden by default, shown only on mobile */
}

.first-row-bottom-mobile {
     width: 100%;
     padding-bottom: 6px;
     border-bottom: 1px solid #ccc;
}

.second-row-bottom-mobile {
     width: 100%;
     padding-top: 9px;
}

#add-text {
     position: absolute;
     top: 15px;
     left: 20px;
}

.link-btn {
     border: 1px solid #040223;
     border-radius: 7px;
     background: #04695b;
     font-family: 'Orbitron', 'Trebuchet MS', Arial, sans-serif;
     font-size: 0.7em;
     color: #fffacd;
     font-weight: bold;
     cursor: pointer;
     padding: 5px 10px;
     margin: 0 2px 0 0;
     transition: color 0.2s;
     z-index: 999;
}

.link-btn:hover,
.link-btn:focus {
     color: #cb0702;
     text-shadow: 7px 7px 7px #eae6b435;
     outline: none;
}

/* Elements Close Button for Mobile/Tablet */
.elements-close-btn {
     display: none;
     /* Hidden by default on desktop */
     position: absolute;
     top: 5px;
     right: 5px;
     background: none;
     border: none;
     font-size: 24px;
     font-weight: bold;
     color: white;
     cursor: pointer;
     padding: 5px;
     line-height: 1;
     border-radius: 50%;
     width: 30px;
     height: 30px;
     display: flex;
     align-items: center;
     justify-content: center;
     transition: all 0.3s ease;
     z-index: 1000;
}

.elements-close-btn:hover {
     background-color: rgba(255, 255, 255, 0.2);
     transform: scale(1.1);
}

.elements-close-btn:active {
     transform: scale(0.95);
}

/* Disabled state for undo/redo buttons */
.link-btn:disabled {
     opacity: 0.5 !important;
     cursor: not-allowed !important;
     color: #999 !important;
     text-shadow: none !important;
     pointer-events: none;
}

.link-btn:disabled:hover,
.link-btn:disabled:focus {
     color: #999 !important;
     text-shadow: none !important;
}

.first-row-bottom {
     width: 54%;
     padding-bottom: 9px;
     border-bottom: 1px solid #ccc;
}

.second-row-bottom {
     width: 100%;
     padding-top: 9px;
}

.category {
     display: flex;
     flex-direction: row;
     gap: 10px;
     width: 100%;
     overflow-x: auto;
     overflow-y: hidden;
     padding: 5px 0;
     height: auto;
}

.category-btn {
     flex: 0 0 auto;
     font-family: 'Concert One', 'Trebuchet MS', Arial, sans-serif;
     font-size: 0.7em;
     color: #012003;
     font-weight: bold;
     cursor: pointer;
}

.category-btn:hover {
     background-color: #cb0702;
}

.category-btn:active {
     background-color: #ff4500;
}

.hashlink {
     font-family: 'Orbitron', 'Trebuchet MS', Arial, sans-serif;
     font-size: 0.7em;
     font-weight: bold;
     color: #f2f2e5;
     margin-bottom: 20px;
     text-decoration: underline;
     padding-left: 14px;
     padding-right: 14px;
}

.main-content {
     max-width: 100%;
     height: auto;
     margin: 20px;
     padding: 20px;
     background-color: antiquewhite;
     border-color: #031d38;
     border-style: 1px solid;
     border-radius: 5px;
     box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-messages-header {
     text-align: left;
     margin-bottom: 30px;
     padding: 20px;
     background: #04695b;
     color: white;
     border-radius: 10px;
}

.howto-agecalc-container {
     display: flex;
     flex-direction: row;
     width: 100%;
     height: auto;
     border: 1px solid #ccc;
     border-radius: 5px;
     box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
     align-items: flex-start;
     justify-content: space-between;
     gap: 20px;
}

.how-to-use-section {
     text-wrap: wrap;
     width: 45%;
     margin-bottom: 15px;
     padding: 15px;
     border: 1px solid #eee;
     border-radius: 5px;
     box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.text-categories-toc h3 {
     margin: 0 0 15px 0;
     color: #f2f2e5;
     font-size: 1.1em;
}

.age-calculator-section {
     width: 36%;
     margin-bottom: 15px;
     padding: 15px;
     border: 1px solid #eee;
     border-radius: 5px;
     box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.age-btn {
     font-family: 'Orbitron', Arial, sans-serif;
     font-size: 0.7em;
     font-weight: bold;
     text-decoration: underline;
     text-shadow: -1px 2px 6px #f7f7f4;
     cursor: pointer;
     padding: 10px;
     border: 1px solid #ccc;
     background: white;
     border-radius: 7px;
     transition: color 0.2s;
     z-index: 999;
}

/* Birthdate Selectors Styling */
.birthdate-selectors {
     display: flex;
     gap: 10px;
     margin: 10px 0;
     flex-wrap: wrap;
     align-items: center;
}

.birthdate-selectors select {
     font-family: 'Josefin Sans', Arial, sans-serif;
     font-size: 16px;
     font-weight: 500;
     padding: 9px 11px;
     border: 2px solid #ddd;
     border-radius: 6px;
     background-color: #fff;
     color: #333;
     cursor: pointer;
     transition: all 0.3s ease;
     min-width: 100px;
     flex: 1;
}

.birthdate-selectors select:focus {
     outline: none;
     border-color: #04695b;
     box-shadow: 0 0 0 2px rgba(4, 105, 91, 0.2);
}

.birthdate-selectors select:hover {
     border-color: #04695b;
}

#birth-month {
     min-width: 135px;
     max-width: 135px;
     flex: 1.2;
}

#birth-day {
     min-width: 99px;
     max-width: 99px;
     flex: 0.8;
}

#birth-year {
     min-width: 119px;
     max-width: 119px;
     flex: 1;
}

/* Age Result Styling */
.age-result {
     background: #f8f9fa;
     padding: 15px 20px;
     border-radius: 9px;
     margin-top: 15px;
     border-left: 4px solid #04695b;
     box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.age-result p {
     font-size: 18px;
     font-weight: bold;
     color: #333;
     margin: 0;
     text-align: center;
     line-height: 1.4;
}

/* Responsive Design for Age Calculator */
@media screen and (max-width: 768px) {
     .age-calculator-section {
          width: 72%;
          padding: 11px;
     }

     .birthdate-selectors {
          display: flex;
          gap: 10px;
          margin: 10px 0;
          flex-wrap: wrap;
          align-items: center;
     }

     .birthdate-selectors select {
          width: 100%;
          flex: 1 0 100%;
          font-size: 16px;
          padding: 10px 11px;
     }

     .age-result {
          padding: 11px 15px;
     }

     .age-result p {
          font-size: 16px;
     }
}

@media screen and (max-width: 480px) {
     .birthdate-selectors select {
          display: flex;
          gap: 10px;
          margin: 10px 0;
          flex-wrap: wrap;
          align-items: center;
     }

     .age-calculator-section {
          width: 99%;
          padding: 11px;
     }

     #birth-month {
          min-width: 110px;
          max-width: 110px;
          flex: 1.2;
     }

     #birth-day {
          min-width: 90px;
          max-width: 90px;
          flex: 0.8;
     }

     #birth-year {
          min-width: 99px;
          max-width: 99px;
          flex: 1;
     }

     .age-result p {
          font-size: 15px;
     }
}

.footer {
     bottom: 0;
     width: 100%;
     font-size: 0.9em;
     text-align: center;
     display: -webkit-box;
     display: -webkit-flex;
     display: -ms-flexbox;
     display: flex;
     -webkit-box-orient: vertical;
     -webkit-box-direction: normal;
     -webkit-flex-direction: column;
     -ms-flex-direction: column;
     flex-direction: column;
     -webkit-box-align: center;
     -webkit-align-items: center;
     -ms-flex-align: center;
     align-items: center;
     -webkit-box-pack: center;
     -webkit-justify-content: center;
     -ms-flex-pack: center;
     justify-content: center;
     padding: 10px 0;
}

.footer p {
     margin: 5px 0;
     text-align: center;
     width: 100%;
     display: block;
}

.footer a {
     text-decoration: none;
     color: inherit;
}

.footer a:hover {
     text-decoration: underline;
}

.ldocs {
     font-size: 1em;
     justify-content: left;
     padding: 10px 0 0 0;
     margin: 2em 3em 0 2em;
}

.custom-file-label {
     display: inline-block;
     font-family: 'Joefin Sans', 'Trebuchet MS', Arial, sans-serif;
     font-size: 0.7rem;
     font-weight: bold;
     color: #333333;
     background-color: #fff;
     border: 1px solid #031d38;
     border-radius: 4px;
     padding: 5px;
     cursor: pointer;
     transition: background-color 0.3s;
     margin-right: 10px;
     margin-bottom: 0;
}

.custom-file-label:hover {
     background-color: #cb0702;
}

/* TEXT EDIT MODAL */
#edit-text-modal {
     display: inline-block;
     width: 400px;
     height: auto;
     max-width: 90%;
     max-height: 90%;
     font-family: "Josefin Sans", "Trebuchet MS", Arial, sans-serif;
     font-size: 0.9em;
     color: #333;
     line-height: 1.5em;
     background: rgba(255, 255, 255, 0.9);
     border: 1px solid #ccc;
     border-radius: 8px;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
     padding: 45px 10px 10px 10px;
     position: absolute;
     top: 119px;
     left: 45px;
     background: rgb(169 68 14);
     display: flex;
     align-items: center;
     justify-content: left;
     z-index: 9999;
}

.edit-text-content {
     background: #fff;
     padding: 10px 14px;
     border-radius: 8px;
     min-width: 280px;
     max-width: 400px;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
     display: grid;
     grid-template-columns: 1fr 1fr;
     grid-gap: 8px 12px;
     align-items: center;
}

.edit-text-content label {
     margin-top: 0;
     margin-bottom: 2px;
     font-size: 0.85em;
     font-weight: bold;
}

.edit-text-content input,
.edit-text-content select {
     width: 95%;
     margin-bottom: 0;
     font-size: 0.92em;
     padding: 3px 6px;
     box-sizing: border-box;
}

.edit-text-content .modal-controls {
     grid-column: 1 / span 2;
     display: flex;
     justify-content: center;
     gap: 8px;
     padding: 6px 0 0 0;
     height: auto;
     width: 100%;
}

.edit-text-content button {
     margin: 2px 4px;
     font-size: 0.92em;
     padding: 6px 12px;
     background: #007cba;
     color: white;
     border: none;
     border-radius: 4px;
     cursor: pointer;
     transition: background-color 0.3s ease;
}

.edit-text-content button:hover {
     background: #005a8b;
}

.edit-text-content button.active {
     background: #ff6b47;
     font-weight: bold;
}

.edit-text-content button.active:hover {
     background: #e55a3c;
}

/* Font style buttons */
#edit-bold-btn.active {
     font-weight: bold;
}

#edit-italic-btn.active {
     font-style: italic;
}

#edit-underline-btn.active {
     text-decoration: underline;
}

#edit-font-opacity {
     width: 90%;
     margin: 4px 0;
}

#edit-font-opacity {
     width: 50%;
     margin: 9px 0;
}

/* Quill Individual Alignment Button Styles - Using default SVG icons */
/* Remove custom content to show Quill's native SVG icons */

/* Active state for alignment buttons */
.ql-align.ql-active .ql-stroke {
     stroke: #06c;
}

/* Ensure alignment buttons have consistent styling */
.ql-toolbar .ql-align {
     width: 28px;
     height: 28px;
     display: inline-flex;
     align-items: center;
     justify-content: center;
     border: 1px solid #ccc;
     border-radius: 3px;
     margin: 1px;
     cursor: pointer;
     background: #fff;
     transition: all 0.15s ease;
}

.ql-toolbar .ql-align:hover {
     background: #f0f0f0;
     border-color: #999;
}

.ql-toolbar .ql-align:hover .ql-stroke {
     stroke: #333;
}

.ql-toolbar .ql-align.ql-active {
     background: #e6f3ff;
     border-color: #06c;
}

/* Style the SVG icons */
.ql-toolbar .ql-align svg {
     width: 16px;
     height: 16px;
}

.ql-toolbar .ql-align .ql-stroke {
     stroke: #444;
     stroke-width: 2;
     transition: stroke 0.15s ease;
}

/* Ensure alignment buttons have consistent styling */
.ql-toolbar .ql-align {
     width: 28px;
     height: 28px;
     display: inline-flex;
     align-items: center;
     justify-content: center;
     border: 1px solid #ccc;
     border-radius: 3px;
     margin: 1px;
     cursor: pointer;
     background: #fff;
     transition: all 0.15s ease;
}

.ql-toolbar .ql-align:hover {
     background: #f0f0f0;
     border-color: #999;
}

.ql-toolbar .ql-align.ql-active {
     background: #e6f3ff;
     border-color: #06c;
}

/* Ensure proper spacing between toolbar groups */
.ql-toolbar .ql-formats {
     margin-right: 15px;
}

/* Make toolbar more compact and organized */
.ql-toolbar {
     border: 1px solid #ccc;
     border-bottom: none;
     border-radius: 4px 4px 0 0;
     padding: 8px;
     background: #f8f8f8;
}

.ql-container {
     border: 1px solid #ccc;
     border-top: none;
     border-radius: 0 0 4px 4px;
}

/* ========================================
   SOCIAL MEDIA SHARING STYLES
   ======================================== */

.social-share-container {
     position: absolute;
     background: rgba(255, 255, 255, 0.95);
     backdrop-filter: blur(10px);
     border: 2px solid #04695b;
     border-radius: 12px;
     box-shadow: 0 9px 32px rgba(0, 0, 0, 0.3);
     z-index: 1000;
     animation: shareContainerFadeIn 0.3s ease-out;
     font-family: 'Josefin Sans', Arial, sans-serif;
}

/* Container positioning and sizing based on requirements */
#social-share-container-top {
     left: 0;
     top: 40px;
     width: min(81%, 450px);
     height: 479px;
     overflow-y: hidden;
}

#social-share-container-bottom {
     left: 0;
     bottom: 81px;
     width: min(81%, 450px);
     height: 450px;
     overflow-y: hidden;
}

.social-share-header {
     display: flex;
     justify-content: space-between;
     align-items: center;
     padding: 11px 16px;
     background: #04695b;
     color: white;
     border-radius: 10px 10px 0 0;
     margin-bottom: 0;
}

.social-share-header h3 {
     margin: 0;
     font-size: 16px;
     font-weight: 600;
     font-family: 'Josefin Sans', Arial, sans-serif;
     color: #f2f2e5;
}

.close-share-btn {
     background: transparent;
     border: none;
     color: white;
     font-size: 20px;
     font-weight: bold;
     cursor: pointer;
     padding: 0;
     width: 24px;
     height: 24px;
     display: flex;
     align-items: center;
     justify-content: center;
     border-radius: 50%;
     transition: background-color 0.3s ease;
}

.close-share-btn:hover {
     background-color: rgba(255, 255, 255, 0.2);
}

.social-platforms {
     display: grid;
     grid-template-columns: repeat(4, 1fr);
     gap: 7px;
     padding: 14px;
     height: calc(480px - 60px);
     overflow-y: hidden;
     align-content: start;
}

.social-btn {
     display: flex;
     flex-direction: column;
     align-items: center;
     justify-content: center;
     padding: 10px 7px;
     border: none;
     border-radius: 9px;
     background: transparent;
     cursor: pointer;
     transition: all 0.3s ease;
     text-decoration: none;
     color: #333;
     font-family: 'Josefin Sans', Arial, sans-serif;
     font-size: 11px;
     font-weight: 500;
     min-height: 80px;
}

.social-btn:hover,
.social-btn:focus {
     transform: translateY(-2px);
     background: transparent;
     box-shadow: 0 4px 12px rgba(0, 123, 204, 0.2);
     outline: none;
}

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

.social-icon {
     font-size: 24px;
     margin-bottom: 4px;
     line-height: 1;
     display: flex;
     align-items: center;
     justify-content: center;
}

.social-icon img {
     width: 24px;
     height: 24px;
     transition: all 0.3s ease;
}

.social-btn span {
     font-size: 10px;
     text-align: center;
     line-height: 1.2;
     max-width: 100%;
     word-wrap: break-word;
}

/* Platform-specific colors on hover */
.social-btn.instagram:hover {
     background: transparent;
     color: #E4405F;
     box-shadow: 0 4px 12px rgba(228, 64, 95, 0.3);
     transform: translateY(-3px);
}

.social-btn.whatsapp:hover {
     background: transparent;
     color: #25D366;
     box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
     transform: translateY(-3px);
}

.social-btn.facebook:hover {
     background: transparent;
     color: #1877F2;
     box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
     transform: translateY(-3px);
}

.social-btn.imessages:hover {
     background: transparent;
     color: #007AFF;
     box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
     transform: translateY(-3px);
}

.social-btn.messages:hover {
     background: transparent;
     color: #34C759;
     box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3);
     transform: translateY(-3px);
}

.social-btn.youtube:hover {
     background: transparent;
     color: #FF0000;
     box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
     transform: translateY(-3px);
}

.social-btn.slack:hover {
     background: transparent;
     color: #4A154B;
     box-shadow: 0 4px 12px rgba(74, 21, 75, 0.3);
     transform: translateY(-3px);
}

.social-btn.snapchat:hover {
     background: transparent;
     color: #FFFC00;
     box-shadow: 0 4px 12px rgba(255, 252, 0, 0.4);
     transform: translateY(-3px);
}

.social-btn.gmail:hover {
     background: transparent;
     color: #EA4335;
     box-shadow: 0 4px 12px rgba(234, 67, 53, 0.3);
     transform: translateY(-3px);
}

.social-btn.tiktok:hover {
     background: transparent;
     color: #ff0050;
     box-shadow: 0 4px 12px rgba(255, 0, 80, 0.3);
     transform: translateY(-3px);
}

.social-btn.wechat:hover {
     background: transparent;
     color: #07C160;
     box-shadow: 0 4px 12px rgba(7, 193, 96, 0.3);
     transform: translateY(-3px);
}

/* Animation for container appearance */
@keyframes shareContainerFadeIn {
     from {
          opacity: 0;
          transform: translateY(-10px) scale(0.95);
     }

     to {
          opacity: 1;
          transform: translateY(0) scale(1);
     }
}

@keyframes slideInRight {
     from {
          transform: translateX(100%);
          opacity: 0;
     }

     to {
          transform: translateX(0);
          opacity: 1;
     }
}

@keyframes slideOutRight {
     from {
          transform: translateX(0);
          opacity: 1;
     }

     to {
          transform: translateX(100%);
          opacity: 0;
     }
}

@keyframes fadeOut {
     from {
          opacity: 1;
     }

     to {
          opacity: 0;
     }
}

/* ========================================
   APPLE DEVICE SPECIFIC MEDIA QUERIES
   ======================================== */

/* iPad in general landscape mode (all sizes) - Ensure desktop canvas */
@media screen and (min-width: 768px) {

     /* All iPads in landscape should prioritize desktop canvas size */
     .canvas-container,
     .birthday-canvas {
          width: 450px !important;
          height: 675px !important;
          min-width: 450px !important;
          max-width: 450px !important;
          min-height: 675px !important;
          max-height: 675px !important;
     }
}

/* iPhone Pro Max (428px-430px) and iPhone Plus (414px-416px) */
@media screen and (min-width: 390px) and (max-width: 430px) and (-webkit-min-device-pixel-ratio: 3) {

     /* Use small mobile layout */
     .main {
          position: relative;
          width: 310px;
          height: 452px;
          min-width: 310px;
          max-width: 310px;
          min-height: 452px;
          max-height: 452px;
          margin: 5px 3px 5px 3px;
     }

     .controls {
          position: absolute;
          bottom: 5px;
          left: 3px;
          width: 280px;
          min-width: 280px;
          max-width: 280px;
          height: 410px;
          min-height: 410px;
          max-height: 410px;
          margin: 8px 0px 8px 3px;
          padding: 3px 3px 0 3px;
          background-color: #04695b;
          overflow: hidden;
     }

     .canvas-container,
     .birthday-canvas {
          width: 290px;
          height: 434px;
          min-width: 290px;
          max-width: 290px;
          min-height: 434px;
          max-height: 434px;
          margin: 8px 0px 8px 3px;
          overflow: hidden;
     }

     canvas {
          width: 290px !important;
          min-width: 290px !important;
          max-width: 290px !important;
          height: 434px !important;
          min-height: 434px !important;
          max-height: 434px !important;
          margin: 0 !important;
          object-fit: contain;
          display: block;
          touch-action: manipulation;
          user-select: none;
     }

     #elements {
          display: inline-block !important;
     }

     .elements-close-btn {
          display: flex !important;
     }

     .hashlink {
          font-size: 0.6em;
          padding-left: 1px;
          padding-right: 14px;
     }
}

/* iPhone Standard (375px-390px) */
@media screen and (min-width: 375px) and (max-width: 390px) and (-webkit-min-device-pixel-ratio: 2) {

     /* Use small mobile layout */
     .logo {
          margin: 10px 0 0 2px;
     }

     .main {
          position: relative;
          width: 310px;
          height: 452px;
          min-width: 310px;
          max-width: 310px;
          min-height: 452px;
          max-height: 452px;
          margin: 5px 3px 5px 3px;
     }

     .controls {
          position: absolute;
          bottom: 5px;
          left: 3px;
          width: 280px;
          min-width: 280px;
          max-width: 280px;
          height: 410px;
          min-height: 410px;
          max-height: 410px;
          margin: 8px 0px 8px 3px;
          padding: 3px 3px 0 3px;
          background-color: #04695b;
          overflow: hidden;
     }

     #elements {
          display: inline-block !important;
     }

     .elements-close-btn {
          display: flex !important;
     }

     .hashlink {
          font-size: 0.6em;
          padding-left: 1px;
          padding-right: 14px;
     }
}

/* iPhone SE and older (320px-375px) */
@media screen and (min-width: 320px) and (max-width: 375px) and (-webkit-min-device-pixel-ratio: 2) {

     /* Use small mobile layout */
     .logo {
          margin: 10px 0 0 2px;
     }

     .main {
          position: relative;
          width: 310px;
          height: 452px;
          min-width: 310px;
          max-width: 310px;
          min-height: 452px;
          max-height: 452px;
          margin: 5px 3px 5px 3px;
     }

     .controls {
          position: absolute;
          bottom: 5px;
          left: 3px;
          width: 280px;
          min-width: 280px;
          max-width: 280px;
          height: 410px;
          min-height: 410px;
          max-height: 410px;
          margin: 8px 0px 8px 3px;
          padding: 3px 3px 0 3px;
          background-color: #04695b;
          overflow: hidden;
     }

     #elements {
          display: inline-block !important;
     }

     .elements-close-btn {
          display: flex !important;
     }

     .hashlink {
          font-size: 0.6em;
          padding-left: 1px;
          padding-right: 14px;
     }
}

/* Mac Desktop/Laptop (1200px and above) */
@media screen and (min-width: 1200px) and (-webkit-min-device-pixel-ratio: 1) {

     /* Use full desktop layout for Mac */
     .main {
          width: 1199px;
          margin: 20px;
     }

     .controls {
          width: 700px;
          max-width: 700px;
          padding: 114px 10px 0 15px;
          margin: 3px 3px 3px 27px;
     }

     #elements {
          display: none !important;
     }

     .elements-close-btn {
          display: none !important;
     }
}

/* ========================================
   ENHANCED RESPONSIVE BREAKPOINTS
   ======================================== */

/* Responsive adjustments for standard Desktop */
@media screen and (min-width: 1010px) and (max-width: 1400px) {

     /* Elements button - hidden on desktop */
     #elements {
          display: none !important;
     }

     /* Elements close button - hidden on desktop 1010px+ */
     .elements-close-btn {
          display: none !important;
     }

     /* CSS rules for screens 1024px to 1400px wide */
     .main {
          width: 1001px;
          margin: 9px 5px 9px 5px;
     }

     h1,
     h2,
     h3 {
          font-size: 1.3em;
          line-height: 1.3em;
          margin: 5px 5px 0px 5px;
     }

     hr {
          margin-top: 1px;
     }

     .text-gallery {
          font-size: 0.9em;
     }

     .controls {
          width: 510px;
          max-width: 510px;
          margin: 10px 0px 10px 18px;
          padding: 114px 5px 0 9px;
     }

     .canvas-container,
     .birthday-canvas {
          margin: 10px 0px 10px 5px;
     }
}

/* Responsive adjustments for large desktop screens (1401px and above) */
@media screen and (min-width: 1401px) {

     /* Elements close button - hidden on large desktop */
     .elements-close-btn {
          display: none !important;
     }
}

/* Responsive adjustments for mobile devices - Enhanced for Apple Devices */
@media screen and (min-width: 471px) and (max-width: 1009px),
screen and (min-width: 471px) and (max-width: 834px) and (orientation: portrait) and (-webkit-min-device-pixel-ratio: 2) {

     #loading-screen {
          align-items: left;
     }

     .loader {
          width: 180px;
          height: 36px;
          font-size: 0.9em;
     }

     /* Elements button - visible on mobile */
     #elements {
          display: inline-block !important;
     }

     /* Elements close button - visible on mobile */
     .elements-close-btn {
          display: flex !important;
     }

     .logo {
          margin: 10px 0 0 2px;
     }

     /* CSS rules for screens 768px wide to 1009px */
     .main {
          position: relative;
          width: 500px;
          margin: 9px 5px 9px 5px;
     }

     h1,
     h2,
     h3 {
          font-size: 1.3em;
          line-height: 1.4em;
          margin: 5px 5px 0px 5px;
     }

     hr {
          margin-top: 5px;
     }

     label {
          color: #EFEFEF;
     }

     .text-gallery {
          font-size: 0.9em;
     }

     .controls {
          position: absolute;
          bottom: 7px;
          left: 5px;
          width: 425px;
          max-width: 425px;
          height: 600px;
          max-height: 600px;
          margin: 10px 0px 10px 5px;
          padding: 99px 5px 0 5px;
          background-color: #04695b;
     }

     .canvas-container,
     .birthday-canvas {
          width: 450px;
          height: 675px;
          max-width: 450px;
          max-height: 675px;
          margin: 10px 0px 10px 5px;
     }

     .text-gallery {
          height: 100px;
     }

     .text-gallery p {
          width: 150px;
          height: 90px;
          border-radius: 3px;
          box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
          font-size: 0.9em;
          font-weight: bold;
          line-height: 1.1em;
          padding: 9px;
          overflow-y: hidden;
          margin-right: 5px;
     }

     .text-gallery .text-item {
          width: 150px;
          height: 90px;
          border-radius: 3px;
          box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
          font-size: 0.9em;
          font-weight: bold;
          line-height: 1.1em;
          padding: 9px;
          overflow-y: hidden;
          margin-right: 5px;
     }

     .main-content {
          margin: 7px;
          padding: 10px;
     }

     /* Social links and buttons rules for screens 768px wide to 1009px */
     .social-platforms {
          grid-template-columns: repeat(3, 1fr);
          gap: 6px;
          padding: 12px;
          height: calc(480px - 60px);
          overflow-y: hidden;
          align-content: start;
     }

     .social-btn {
          min-height: 70px;
          padding: 8px 6px;
     }

     .social-icon {
          font-size: 20px;
     }

     .social-icon img {
          width: 20px;
          height: 20px;
     }

     .social-btn span {
          font-size: 9px;
     }

     .social-share-header h3 {
          font-size: 14px;
     }
}

/* Responsive adjustments for smaller mobile devices - Enhanced for Apple Devices */
@media screen and (min-width: 240px) and (max-width: 470px),
screen and (min-width: 320px) and (max-width: 390px) and (-webkit-min-device-pixel-ratio: 2) {

     #loading-screen {
          align-items: left;
     }

     .loader {
          width: 140px;
          height: 30px;
          font-size: 0.9em;
     }

     /* Elements button - visible on small mobile */
     #elements {
          display: inline-block !important;
     }

     /* Elements close button - visible on small mobile */
     .elements-close-btn {
          display: flex !important;
     }

     .logo {
          margin: 10px 0 0 2px;
     }

     /* CSS rules for screens 320px wide to 470px */
     .main {
          position: relative;
          width: 310px;
          height: 452px;
          margin: 5px 3px 5px 3px;
     }

     h1,
     h2,
     h3 {
          font-size: 1.1em;
          line-height: 1.2em;
          margin: 5px 3px 0px 3px;
     }

     p {
          font-size: 0.9em;
          line-height: 1.4em;
          margin: 9px 0;
     }

     hr {
          margin-top: 3px;
     }

     label {
          color: #EFEFEF;
     }

     .text-gallery {
          font-size: 0.9em;
     }

     .controls {
          position: absolute;
          bottom: 5px;
          left: 3px;
          width: 280px;
          max-width: 280px;
          height: 410px;
          max-height: 410px;
          margin: 8px 0px 8px 3px;
          padding: 3px 3px 0 3px;
          background-color: #04695b;
          overflow: hidden;
     }

     .canvas-container,
     .birthday-canvas {
          width: 290px;
          height: 434px;
          max-width: 290px;
          max-height: 434px;
          margin: 8px 0px 8px 3px;
          overflow: hidden;
     }

     canvas {
          width: 290px !important;
          min-width: 290px !important;
          max-width: 290px !important;
          height: 434px !important;
          min-height: 434px !important;
          max-height: 434px !important;
          margin: 0 !important;
          object-fit: contain;
          display: block;
          touch-action: manipulation;
          user-select: none;
     }

     .text-gallery {
          height: 99px;
     }

     .text-gallery p {
          width: 110px;
          height: 81px;
          border-radius: 3px;
          box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
          font-size: 0.7em;
          font-weight: bold;
          line-height: 1.4em;
          padding: 6px;
          overflow-y: hidden;
          margin-right: 3px;
     }

     .text-gallery .text-item {
          width: 110px;
          height: 81px;
          border-radius: 3px;
          box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
          font-size: 0.7em;
          font-weight: bold;
          line-height: 1.4em;
          padding: 6px;
          overflow-y: hidden;
          margin-right: 3px;
     }

     .image-gallery {
          height: 150px;
          max-height: 150px;
          padding-left: 2px;
          padding-top: 3px;
     }

     .image-gallery img {
          width: 90px;
          height: auto;
          margin-right: 3px;
     }

     .first-row {
          gap: 15px;
          margin-top: 3px;
     }

     .second-row {
          gap: 20px;
          margin-top: 15px;
     }

     .first-row-bottom {
          width: 65%;
     }

     .link-btn {
          font-size: 0.6em;
          margin: 0 15px 0 0;
     }

     .how-to-use {
          width: 270px;
          bottom: 60px;
          left: 3px;
     }

     .how-to-use ol {
          font-size: 0.7em;
          line-height: 1.3em;
     }

     .font-select {
          font-size: 0.6em;
          height: 20px;
          padding: 1px 3px;
     }

     label {
          font-size: 0.6em;
          padding-right: 8px;
     }

     .category-btn {
          font-size: 0.6em;
          padding: 3px 6px;
     }

     #file-upload-button {
          font-size: 0.6em;
          height: 22px;
          width: 32%;
          padding: 3px;
     }

     .custom-image-label {
          font-size: 0.6em;
          padding: 3px;
          margin-right: 6px;
     }

     .file-name {
          font-size: 0.6em;
     }

     .text-editor {
          width: 270px;
          height: 280px;
          bottom: 60px;
          left: 12px;
     }

     #quill-editor {
          height: 220px;
     }

     .quill-controls button {
          padding: 6px 11px;
          font-size: 0.7em;
     }

     #edit-text-modal {
          width: 280px;
          top: 90px;
          left: 25px;
          padding: 35px 8px 8px 8px;
     }

     .edit-text-content {
          min-width: 220px;
          max-width: 280px;
          padding: 8px 10px;
          grid-gap: 6px 8px;
     }

     .edit-text-content label {
          font-size: 0.75em;
     }

     .edit-text-content input,
     .edit-text-content select {
          font-size: 0.8em;
          padding: 2px 4px;
     }

     .edit-text-content button {
          font-size: 0.8em;
          padding: 4px 8px;
     }

     .main-content {
          margin: 5px;
          padding: 8px;
     }

     /* Social share containers for small mobile */
     #social-share-container-top,
     #social-share-container-bottom {
          width: min(95%, 290px);
          height: 360px;
     }

     .social-platforms {
          grid-template-columns: repeat(3, 1fr);
          gap: 4px;
          padding: 8px;
          height: calc(360px - 50px);
     }

     .social-btn {
          min-height: 60px;
          padding: 6px 4px;
     }

     .social-icon {
          font-size: 18px;
     }

     .social-icon img {
          width: 18px;
          height: 18px;
     }

     .social-btn span {
          font-size: 8px;
     }

     .social-share-header h3 {
          font-size: 12px;
     }

     /* Mobile Control Block Visibility */
     .canvas-controls {
          display: none !important;
          /* Hide desktop controls on mobile */
     }

     .canvas-controls-mobile {
          left: 9px;
          display: block !important;
          /* Show mobile controls on mobile */
     }

     /* Hide Share button on mobile screens for cleaner interface */
     #share-btn-top {
          display: none !important;
     }
}

/* Age Calculator Result Styling */
.age-result {
     background: #fff;
     padding: 15px 20px;
     border-radius: 8px;
     margin-top: 15px;
     box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
     border-left: 4px solid #04695b;
}

.age-result p {
     font-size: 18px;
     font-weight: bold;
     color: #333;
     margin: 0;
     text-align: left;
     line-height: 1.4;
}

@media screen and (max-width: 767px) {
     .age-result {
          padding: 11px 15px;
     }

     .age-result p {
          font-size: 16px;
     }
}

/* ========================================
   BRAND TEXT WATERMARK
   ======================================== */

.brand {
     position: absolute;
     bottom: 2px;
     left: 11px;
     font-family: 'League Spartan', Arial, sans-serif;
     font-size: 10px;
     font-weight: 500;
     color: #040223;
     background: rgba(255, 255, 255, 0.1);
     padding: 5px;
     border-radius: 3px;
     backdrop-filter: blur(2px);
     z-index: 9999;
     pointer-events: none;
     user-select: none;
     -webkit-user-select: none;
     -moz-user-select: none;
     -ms-user-select: none;
     text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
     white-space: nowrap;
     display: block;
     visibility: visible;
     opacity: 0.9;
     transition: opacity 0.3s ease;
}

.brand::before {
     content: "craft with itsBirthday.net";
}

/* Canvas container positioning for brand */
.canvas-container {
     position: relative;
     overflow: hidden;
}

/* Responsive adjustments for brand text */
@media screen and (max-width: 470px) {
     .brand {
          font-size: 9px;
          bottom: 4px;
          left: 6px;
          padding: 1px 4px;
     }

     .second-row-bottom-mobile {
          padding-top: 0px;
          margin-top: 5px;
     }
}

@media screen and (min-width: 471px) and (max-width: 768px) {
     .brand {
          font-size: 10px;
          bottom: 7px;
          left: 6px;
          padding: 2px 5px;
     }

     .second-row-bottom-mobile {
          padding-top: 0px;
     }
}

@media screen and (min-width: 768px) {
     .brand {
          font-size: 10px;
          bottom: 1px;
          left: 14px;
          padding: 2px 5px;
     }

     .first-row-bottom {
          padding-bottom: 7px;
     }

     .second-row-bottom {
          padding-top: 7px;
     }
}

@media screen and (min-width: 1010px) {
     .brand {
          font-size: 10px;
          bottom: 2px;
          left: 14px;
          padding: 2px 2px 2px 5px;
     }
}

/* Quick Navigation Styles */
.quick-navigation {
     text-align: left;
     margin: 2px 0 0 10px;
     padding: 2px 9px 0px 2px;
     font-family: 'Josefin Sans', Arial, sans-serif;
}

.nav-link {
     color: #040223;
     font-weight: 500;
     font-size: 16px;
     margin: 0 0 0 10px;
     transition: color 0.3s ease, transform 0.3s ease, text-decoration 0.3s ease;
}

.nav-link:hover {
     color: #ffffff;
     transform: translateY(-1px);
     text-decoration: 1px #e4ebc5 underline;
}

.nav-separator {
     color: #040223;
     margin: 0 10px;
     font-weight: normal;
}

/* Mobile responsive */
@media screen and (max-width: 768px) {
     .quick-navigation {
          padding: 2px 5px 2px 2px;
          margin: 2px 0 0 2px;
     }

     .nav-link {
          font-size: 11px;
          padding: 2px 2px;
          margin: 2px;
     }

     .nav-separator {
          margin: 0 5px;
     }
}