:root {
    --primary-color: #4f46e5;
    --primary-hover: #3730a3;
    --success-color: #10b981;
    --success-hover: #059669;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --secondary-color: #6b7280;
    --secondary-hover: #4b5563;
    --background-primary: #ffffff;
    --background-secondary: #f8fafc;
    --background-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --border-color: #e2e8f0;
    --border-focus: #4f46e5;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(79, 70, 229, 0.1) 0%, rgba(236, 72, 153, 0.1) 50%, rgba(59, 130, 246, 0.1) 100%);
    z-index: -1;
    animation: gradientShift 8s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.glass-container {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: var(--shadow-xl);
    border-radius: 24px;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.form-input, .form-select, .form-textarea {
    border-radius: 12px;
    border: 2px solid var(--border-color);
    padding: 14px 16px;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--background-primary);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    outline: none;
    transform: translateY(-2px);
}

.form-input:hover, .form-select:hover, .form-textarea:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
}
input[type="color"].form-input {
    padding: 4px;
    height: 3.5rem;
}

.btn {
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl) !important;
}

.btn:active {
    transform: translateY(-1px);
}
.btn:disabled, .btn[disabled] {
    background: #9ca3af !important;
    cursor: not-allowed !important;
    box-shadow: var(--shadow-sm) !important;
    transform: translateY(0) !important;
    filter: grayscale(80%);
}
.btn:disabled::before, .btn[disabled]::before {
    display:none;
}


.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6366f1 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #4c1d95 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #64748b 100%);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--secondary-hover) 0%, #334155 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #34d399 100%);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--success-hover) 0%, #065f46 100%);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #f87171 100%);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--danger-hover) 0%, #991b1b 100%);
}

.btn-light {
    background: #f3f4f6;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}
.btn-light:hover:not(:disabled) {
    background: #e5e7eb;
    border-color: #d1d5db;
    box-shadow: var(--shadow-md) !important;
}
.btn-light::before {
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
}


.card {
    background: var(--background-primary);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #ec4899, #f59e0b);
    z-index: 1;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.main-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.main-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    background: linear-gradient(135deg, #4f46e5 0%, #ec4899 50%, #f59e0b 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    animation: titleGlow 3s ease-in-out infinite alternate;
    color: transparent;
}

@keyframes titleGlow {
    from { filter: drop-shadow(0 0 8px rgba(79, 70, 229, 0.2)); }
    to { filter: drop-shadow(0 0 15px rgba(236, 72, 153, 0.4)); }
}

.main-subtitle {
    font-size: 1.15rem;
    color: var(--text-primary);
    font-weight: 500;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

.custom-checkbox {
    appearance: none;
    background: var(--background-primary);
    margin-right: 12px;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: inline-grid;
    place-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.custom-checkbox::before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 3px;
    transform: scale(0);
    transition: 0.3s transform ease-in-out;
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.custom-checkbox:checked {
    border-color: var(--primary-color);
}
.custom-checkbox:checked::before {
    transform: scale(1);
}

.custom-checkbox:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

#qrContainer {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 2rem auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--background-primary);
    padding: 16px;
}

#qrCanvas {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
    animation: modalFadeIn 0.3s ease-out;
}

#customAlertModal {
    z-index: 1050;
}


@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--background-primary);
    padding: 2rem;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 500px;
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
}
#actualShareModal .modal-content {
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}


#customAlertModal .modal-content {
    max-width: 400px;
    padding: 1.5rem;
    border-radius: 16px;
}


@keyframes modalSlideIn {
    from { transform: translateY(-20px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

#customAlertModal .modal-header {
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}


.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

#customAlertModal .modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close-button {
    color: var(--text-tertiary);
    transition: all 0.2s ease;
    padding: 8px;
    border-radius: 8px;
    background: transparent;
    border:none;
}

#customAlertModal .modal-close-button {
    padding: 0.3rem;
    position: absolute;
    top: 1rem;
    right: 1rem;
}


.modal-close-button:hover {
    color: var(--text-primary);
    background: var(--background-tertiary);
}

.modal-body {
    color: var(--text-secondary);
    line-height: 1.6;
}
#actualShareModal .modal-body {
    padding-bottom: 1rem;
}

#customAlertModal .modal-body {
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    text-align: center;
}

.modal-footer {
    text-align: right;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1.5rem;
}
#actualShareModal .modal-footer {
    margin-top: 0.5rem;
    padding-top: 1rem; /* Ensure there's padding if content above is short */
}


#customAlertModal .modal-footer {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
    display: flex;
    justify-content: center;
}

#customAlertModal .modal-footer .btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
}
#customAlertModal .modal-footer .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6366f1 100%);
}


.site-footer {
    text-align: center;
    padding: 3rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    color: rgba(255, 255, 255, 0.8);
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
}

.site-footer a {
    color: #fbbf24;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: #f59e0b;
}

.site-footer .fa-heart {
    color: #ef4444;
    animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin-kf 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin-kf {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .glass-container {
        margin-top: 1rem;
        margin-bottom: 1rem;
        border-radius: 16px;
    }
    .card {
        padding: 24px;
        margin-bottom: 1.5rem;
    }
    .main-title {
        font-size: 2.2rem;
    }
    #qrContainer {
        width: 240px;
        height: 240px;
        padding: 12px;
    }
    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    #customAlertModal .modal-content {
        padding: 1.25rem;
    }
    .main-subtitle {
        font-size: 1rem;
    }
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 2rem 0;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.file-input-label {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    color: var(--text-secondary);
}

.file-input-label:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    color: var(--primary-color);
}

#logoPreview {
    margin-top: 1rem;
    height: 80px;
    width: 80px;
    object-fit: contain;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    padding: 8px;
    background: var(--background-primary);
    box-shadow: var(--shadow-sm);
}

.share-button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.share-button {
    width: 100%;
    padding: 14px 22px;
    font-weight: 500;
    justify-content: flex-start !important;
}

.share-button svg, .share-button i {
    margin-right: 12px;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

label[for="chkHeartShape"] {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
}

#noteDisplayContainer {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--background-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    min-height: 60px;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#noteDisplayText {
    color: var(--text-secondary);
    font-weight: 500;
}

#actualShareModalImagePreview {
    width: 100%;
    max-width: 280px;
    height: auto;
    margin: 0 auto 1.5rem auto;
    display: block;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--background-secondary);
    box-shadow: var(--shadow-md);
}

.loader {
    transform: rotateZ(45deg);
    perspective: 1000px;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    color: #fff;
}
.loader:before,
.loader:after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: inherit;
    height: inherit;
    border-radius: 50%;
    transform: rotateX(70deg);
    animation: 1s spin-loader-kf linear infinite;
}
.loader:after {
    color: #FF3D00;
    transform: rotateY(70deg);
    animation-delay: .4s;
}

@keyframes spin-loader-kf {
    0%,
    100% {
        box-shadow: .2em 0px 0 0px currentcolor;
    }
    12% {
        box-shadow: .2em .2em 0 0 currentcolor;
    }
    25% {
        box-shadow: 0 .2em 0 0px currentcolor;
    }
    37% {
        box-shadow: -.2em .2em 0 0 currentcolor;
    }
    50% {
        box-shadow: -.2em 0 0 0 currentcolor;
    }
    62% {
        box-shadow: -.2em -.2em 0 0 currentcolor;
    }
    75% {
        box-shadow: 0px -.2em 0 0 currentcolor;
    }
    87% {
        box-shadow: .2em -.2em 0 0 currentcolor;
    }
}