/* ============================================
   Send Message Page - Christmas Theme
   Complete redesign with festive styling

   TABLE OF CONTENTS:
   1. CSS Variables & Base
   2. Animations
   3. Layout - Top Bar
   4. Layout - Main Content
   5. Components - Loading State
   6. Components - Step Header
   7. Components - Tree Preview
   8. Components - Gift Grid
   9. Components - Message Card V2
   10. Components - Message Card (Legacy)
   11. Components - Toggle
   12. Components - Buttons
   13. Components - Success State
   14. Components - Already Sent State
   15. Components - Error State
   16. Components - Download Steps
   17. Components - Toast
   18. Components - Report Modal
   19. Layout - Footer
   20. Responsive - Mobile First
   21. Responsive - Safe Area
   ============================================ */

/* ============================================
   1. CSS Variables & Base
   ============================================ */
.send-message-page {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    background: linear-gradient(180deg, #0a1628 0%, #1a0a28 50%, #0a1628 100%);
    padding: 0;
    margin: 0;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.send-message-page * {
    box-sizing: border-box;
}

/* ============================================
   2. Animations
   ============================================ */

/* Snowfall */
@keyframes snowfall {
    0% { transform: translateY(-20px) rotate(0deg); }
    100% { transform: translateY(100vh) rotate(360deg); }
}

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tree Bounce */
@keyframes treeBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Spin */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Christmas Gradient */
@keyframes christmasGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Success Pop */
@keyframes successPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Confetti Fall */
@keyframes confettiFall {
    0% {
        top: 50%;
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
    100% {
        top: 150%;
        opacity: 0;
        transform: translateY(0) rotate(720deg);
    }
}

/* Christmas Glow */
@keyframes christmasGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(196, 30, 58, 0.3), 0 0 40px rgba(196, 30, 58, 0.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(34, 139, 34, 0.3), 0 0 60px rgba(34, 139, 34, 0.1);
    }
}

/* Input Shake */
@keyframes inputShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

/* Card Shake */
@keyframes cardShake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-10px); }
    30% { transform: translateX(10px); }
    50% { transform: translateX(-8px); }
    70% { transform: translateX(8px); }
    90% { transform: translateX(-4px); }
}

/* Modal Slide In */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   Snowfall Effect
   ============================================ */
.snowfall {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -20px;
    color: rgba(255, 255, 255, 0.8);
    animation: snowfall linear infinite;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* ============================================
   3. Layout - Top Bar
   ============================================ */
.send-message-page .top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.send-message-page .back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.send-message-page .back-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.send-message-page .top-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.send-message-page .report-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.send-message-page .report-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.send-message-page .report-btn svg {
    opacity: 0.8;
}

.send-message-page .logo-mini {
    display: flex;
    align-items: center;
    gap: 6px;
}

.send-message-page .logo-mini span:first-child {
    font-size: 20px;
}

.send-message-page .logo-text {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    display: none;
}

/* ============================================
   4. Layout - Main Content
   ============================================ */
.send-message-page .main-content {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 60px 16px 24px;
    position: relative;
    z-index: 1;
    flex: 1;
}

/* Step Sections */
.step-section {
    display: none;
    animation: fadeInUp 0.4s ease-out;
}

.step-section.active {
    display: block;
}

/* ============================================
   5. Components - Loading State
   ============================================ */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 20px;
}

.loading-tree {
    font-size: 72px;
    animation: treeBounce 1s ease-in-out infinite;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #c41e3a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    font-weight: 500;
}

/* ============================================
   6. Components - Step Header
   ============================================ */
.step-header-container {
    text-align: center;
    margin-bottom: 12px;
    position: relative;
}

.step-indicator-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
}

.step-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.step-dot.active {
    background: linear-gradient(135deg, #c41e3a, #8b0000);
    border-color: #c41e3a;
    color: #fff;
    box-shadow: 0 0 15px rgba(196, 30, 58, 0.4);
}

.step-dot.completed {
    background: linear-gradient(135deg, #228b22, #006400);
    border-color: #228b22;
    color: #fff;
}

.step-line {
    width: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.step-line.active,
.step-line.completed {
    background: linear-gradient(90deg, #228b22, #c41e3a);
}

.back-step-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-step-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 2px;
    line-height: 1.3;
}

.section-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    line-height: 1.4;
}

/* ============================================
   7. Components - Tree Preview
   ============================================ */
.tree-preview-container {
    margin-bottom: 10px;
}

.tree-preview-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: christmasGlow 4s ease-in-out infinite;
}

.tree-preview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #c41e3a, #ffd700, #228b22, #c41e3a);
    background-size: 300% 100%;
    animation: christmasGradient 3s ease infinite;
}

.tree-preview-card.small {
    padding: 10px;
}

.tree-preview-card.small .tree-preview-image {
    max-height: 100px;
}

.tree-preview-card.small .tree-topper-image {
    width: 28px;
    height: 28px;
    margin-bottom: -20px;
}

.tree-preview-card.small .tree-owner-name {
    font-size: 13px;
    margin-top: 6px;
}

.tree-with-topper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 4px;
}

.tree-topper-image {
    width: 32px;
    height: 32px;
    object-fit: contain;
    position: relative;
    z-index: 10;
    margin-bottom: -18px;
    filter: drop-shadow(0 2px 8px rgba(255, 215, 0, 0.5));
}

.tree-preview-image {
    max-width: 100%;
    max-height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.25));
}

.tree-owner-name {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-top: 4px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.tree-owner-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(196, 30, 58, 0.15);
    border: 1px solid rgba(196, 30, 58, 0.3);
    color: #fff;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
}

/* ============================================
   8. Components - Gift Grid
   ============================================ */
.gift-selection-container {
    margin-bottom: 12px;
}

/* Tap hint for gift selection */
.tap-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 165, 0, 0.15));
    border: 1px dashed rgba(255, 215, 0, 0.4);
    border-radius: 12px;
    animation: tapHintPulse 2s ease-in-out infinite;
}

.tap-hint-icon {
    font-size: 20px;
    animation: tapBounce 1s ease-in-out infinite;
}

.tap-hint-text {
    color: #ffd700;
    font-size: 14px;
    font-weight: 600;
}

@keyframes tapHintPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.98);
    }
}

@keyframes tapBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

/* Hide hint when gift is selected */
.tap-hint.hidden {
    display: none;
}

/* First gift pulse animation */
.gift-card.pulse-hint {
    animation: giftPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4);
}

@keyframes giftPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(255, 215, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

.gift-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-height: none;
    overflow-y: visible;
    padding: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.gift-grid::-webkit-scrollbar {
    width: 6px;
}

.gift-grid::-webkit-scrollbar-track {
    background: transparent;
}

.gift-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.gift-card {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(196, 30, 58, 0.3);
    user-select: none;
    -webkit-user-select: none;
}

.gift-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.03);
}

.gift-card.selected {
    background: rgba(196, 30, 58, 0.15);
    border-color: #c41e3a;
    box-shadow: 0 0 20px rgba(196, 30, 58, 0.3);
}

.gift-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    -webkit-user-drag: none;
}

.gift-selected-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 14px;
    height: 14px;
    background: #c41e3a;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.gift-selected-badge svg {
    width: 10px;
    height: 10px;
}

.gift-card.selected .gift-selected-badge {
    display: flex;
}

/* ============================================
   9. Components - Message Card V2 (Frontend Style)
   ============================================ */
.message-card-container {
    margin-bottom: 12px;
    margin-left: -4px;
    margin-right: -4px;
}

.message-card-v2 {
    position: relative;
    padding-top: 28px;
}

.message-card-v2.shake {
    animation: cardShake 0.5s ease;
}

.card-gift-circle {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.card-gift-circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-body {
    background: linear-gradient(180deg, #dcfce7 0%, #f0fdf4 100%);
    border-radius: 16px;
    padding: 36px 16px 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.card-from-section {
    margin-bottom: 0;
}

.card-label {
    display: inline;
    font-size: 11px;
    font-weight: 500;
    color: #9ca3af;
    margin-bottom: 4px;
}

/* Required field indicator */
.field-required {
    font-size: 10px;
    color: #f87171;
    margin-left: 6px;
    font-weight: 500;
    animation: requiredPulse 2s ease-in-out infinite;
}

@keyframes requiredPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Message label row */
.message-label-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.card-from-input-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-profile-icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
    background: #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.card-profile-icon svg {
    width: 12px;
    height: 12px;
}

.card-from-input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    color: #1a1a2e;
    padding: 0;
}

.card-from-input:focus {
    outline: none;
}

.card-from-input::placeholder {
    color: #9ca3af;
    font-weight: 500;
}

.card-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 8px 0;
}

.card-message-section {
    margin-bottom: 8px;
}

.card-message-input {
    width: 100%;
    min-height: 60px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    color: #1a1a2e;
    resize: none;
    transition: all 0.2s ease;
}

.card-message-input:focus {
    outline: none;
    border-color: #22c55e;
    background: #fff;
}

.card-message-input::placeholder {
    color: #9ca3af;
}

.card-char-count {
    display: block;
    text-align: right;
    font-size: 10px;
    color: #9ca3af;
    margin-top: 4px;
}

.card-sent-section {
    margin-bottom: 16px;
}

.card-sent-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #9ca3af;
    margin-bottom: 6px;
}

.card-sent-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 14px;
}

.card-sent-date svg {
    color: #9ca3af;
}

.card-send-btn {
    width: 100%;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.35);
}

.card-send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(34, 197, 94, 0.45);
}

.card-send-btn:active:not(:disabled) {
    transform: translateY(0);
}

.card-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: auto !important;
}

.card-send-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ============================================
   10. Components - Message Card (Legacy)
   ============================================ */
.message-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 248, 245, 0.95));
    border-radius: 24px;
    padding: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.message-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #c41e3a, #ffd700, #228b22);
}

.message-card-gift {
    width: 80px;
    height: 80px;
    margin: -30px auto 0;
    background: linear-gradient(135deg, #ffd700, #ffb700);
    border-radius: 50%;
    padding: 12px;
    position: relative;
    z-index: 10;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
    border: 4px solid #fff;
}

.message-card-gift img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.message-card-content {
    padding: 20px 24px 24px;
}

.message-field {
    margin-bottom: 16px;
}

.field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.field-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.03);
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    color: #1a1a2e;
    transition: all 0.2s ease;
}

.field-input:focus {
    outline: none;
    border-color: #c41e3a;
    background: #fff;
}

.field-input::placeholder {
    color: rgba(0, 0, 0, 0.3);
}

.field-textarea {
    width: 100%;
    min-height: 120px;
    background: rgba(0, 0, 0, 0.03);
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    color: #1a1a2e;
    resize: vertical;
    transition: all 0.2s ease;
}

.field-textarea:focus {
    outline: none;
    border-color: #c41e3a;
    background: #fff;
}

.field-textarea::placeholder {
    color: rgba(0, 0, 0, 0.3);
}

.char-count {
    display: block;
    text-align: right;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.4);
    margin-top: 6px;
}

.message-timestamp {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.timestamp-label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.timestamp-date {
    font-size: 14px;
    color: #1a1a2e;
    font-weight: 500;
}

/* ============================================
   11. Components - Toggle
   ============================================ */
.toggle-option {
    margin-bottom: 12px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.toggle-label input {
    display: none;
}

.toggle-slider {
    width: 40px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.3s ease;
}

.toggle-label input:checked + .toggle-slider {
    background: #228b22;
}

.toggle-label input:checked + .toggle-slider::after {
    left: 19px;
}

.toggle-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* ============================================
   12. Components - Buttons
   ============================================ */
.primary-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #c41e3a, #8b0000);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.35);
    text-decoration: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(196, 30, 58, 0.45);
}

.primary-btn:active:not(:disabled) {
    transform: translateY(0);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.primary-btn.send-btn {
    background: linear-gradient(135deg, #228b22, #006400);
    box-shadow: 0 8px 25px rgba(34, 139, 34, 0.35);
}

.primary-btn.send-btn:hover:not(:disabled) {
    box-shadow: 0 12px 35px rgba(34, 139, 34, 0.45);
}

.btn-loading {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================
   13. Components - Success State
   ============================================ */
.success-container {
    text-align: center;
    padding: 10px 0;
}

.success-animation {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
}

.success-icon {
    font-size: 56px;
    animation: successPop 0.5s ease-out;
}

.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confettiFall 2s ease-out forwards;
}

.confetti:nth-child(1) { background: #c41e3a; left: 20%; animation-delay: 0s; }
.confetti:nth-child(2) { background: #ffd700; left: 40%; animation-delay: 0.1s; }
.confetti:nth-child(3) { background: #228b22; left: 60%; animation-delay: 0.2s; }
.confetti:nth-child(4) { background: #c41e3a; left: 80%; animation-delay: 0.3s; }
.confetti:nth-child(5) { background: #ffd700; left: 50%; animation-delay: 0.15s; }

.success-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
}

.success-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 16px;
}

.success-summary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.summary-row:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.summary-value {
    font-size: 12px;
    color: #fff;
    font-weight: 600;
}

.create-tree-cta {
    background: linear-gradient(145deg, rgba(196, 30, 58, 0.15), rgba(139, 0, 0, 0.1));
    border: 1px solid rgba(196, 30, 58, 0.3);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}

.create-tree-cta h3 {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
}

.create-tree-cta p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* ============================================
   14. Components - Already Sent State
   ============================================ */
.already-sent-container {
    text-align: center;
    padding: 10px 0;
}

.already-sent-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.already-sent-title {
    font-size: 20px;
    font-weight: 700;
    color: #228b22;
    margin: 0 0 4px;
}

.already-sent-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 16px;
}

.already-sent-info {
    background: rgba(34, 139, 34, 0.1);
    border: 1px solid rgba(34, 139, 34, 0.3);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 16px;
}

.already-sent-info p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    line-height: 1.4;
}

/* ============================================
   15. Components - Error State
   ============================================ */
.error-container {
    text-align: center;
    padding: 40px 16px;
}

.error-icon {
    font-size: 56px;
    margin-bottom: 14px;
}

.error-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px;
}

.error-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 24px;
    line-height: 1.4;
}

/* ============================================
   16. Components - Download Steps
   ============================================ */
.download-steps {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 16px;
}

.download-steps.compact {
    padding: 14px;
}

.download-steps h4 {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px;
    text-align: center;
}

.download-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 12px;
    text-align: center;
}

.download-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.download-step-number {
    width: 24px;
    height: 24px;
    min-width: 24px;
    background: linear-gradient(135deg, #228b22, #006400);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.download-step-content {
    flex: 1;
    padding-top: 2px;
}

.download-step-title {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.download-step-desc {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.3;
}

.store-buttons-container {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
    flex-wrap: wrap;
}

.store-btn {
    display: inline-block;
    transition: all 0.2s ease;
}

.store-btn:hover {
    transform: scale(1.05);
}

.store-btn img {
    height: 36px;
    width: auto;
}

/* ============================================
   17. Components - Toast
   ============================================ */
.toast-notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 14px 24px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 90%;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-error {
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95), rgba(60, 20, 20, 0.95));
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast-message {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Input Validation */
.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
    animation: inputShake 0.4s ease;
}

.input-error::placeholder {
    color: rgba(239, 68, 68, 0.6);
}

/* ============================================
   18. Components - Report Modal
   ============================================ */
.report-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.report-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.report-modal-content {
    position: relative;
    background: linear-gradient(145deg, #1a2a3a, #0f1a28);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

.report-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.report-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.report-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.report-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.report-modal-body {
    padding: 20px;
}

.report-modal-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 16px;
}

.report-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.report-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.report-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.report-option input {
    display: none;
}

.report-option-check {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: transparent;
}

.report-option-check::after {
    content: '';
    width: 12px;
    height: 12px;
    background: transparent;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.report-option input:checked + .report-option-check {
    border-color: #22c55e;
    background: #22c55e;
}

.report-option input:checked + .report-option-check::after {
    content: '✓';
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    background: transparent;
}

.report-option input:checked ~ span:last-child {
    color: #fff;
}

.report-modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.report-cancel-btn {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.report-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.report-submit-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: linear-gradient(135deg, #c41e3a, #8b0000);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.3);
}

.report-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(196, 30, 58, 0.4);
}

/* Report button as button element */
button.report-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
}

button.report-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

button.report-btn svg {
    opacity: 0.8;
}

/* ============================================
   19. Layout - Footer
   ============================================ */
.footer {
    text-align: center;
    padding: 16px;
    position: relative;
    z-index: 1;
    margin-top: auto;
}

.footer p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
}

/* ============================================
   20. Responsive - Mobile First
   ============================================ */

/* Extra Small (400px+) */
@media (min-width: 400px) {
    .send-message-page .main-content {
        padding: 70px 16px 30px;
    }

    .section-title {
        font-size: 18px;
    }

    .tree-preview-image {
        max-height: 120px;
    }

    .tree-topper-image {
        width: 32px;
        height: 32px;
    }

    .gift-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .card-gift-circle {
        width: 60px;
        height: 60px;
    }

    .card-body {
        padding: 38px 14px 14px;
    }
}

/* Small (480px+) */
@media (min-width: 480px) {
    .send-message-page .main-content {
        padding: 80px 20px 36px;
    }

    .send-message-page .logo-text {
        display: inline;
    }

    .section-title {
        font-size: 20px;
    }

    .section-subtitle {
        font-size: 13px;
    }

    .gift-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .tree-preview-image {
        max-height: 150px;
    }

    .tree-topper-image {
        width: 36px;
        height: 36px;
    }

    .card-gift-circle {
        width: 65px;
        height: 65px;
    }

    .card-body {
        padding: 42px 16px 16px;
    }

    .card-message-input {
        min-height: 70px;
        font-size: 14px;
    }

    .store-btn img {
        height: 40px;
    }
}

/* Medium (768px+) */
@media (min-width: 768px) {
    .send-message-page .main-content {
        padding: 90px 28px 44px;
        max-width: 540px;
    }

    .send-message-page .top-bar {
        height: 64px;
        padding: 0 28px;
    }

    .send-message-page .report-btn {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* Large (1024px+) */
@media (min-width: 1024px) {
    .section-title {
        font-size: 22px;
    }

    .gift-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 12px;
    }

    .tree-preview-image {
        max-height: 180px;
    }

    .tree-topper-image {
        width: 40px;
        height: 40px;
    }

    .store-btn img {
        height: 44px;
    }
}

/* Small Mobile (< 380px) */
@media (max-width: 379px) {
    .send-message-page .main-content {
        padding: 60px 10px 20px;
    }

    .section-title {
        font-size: 15px;
    }

    .section-subtitle {
        font-size: 11px;
    }

    .gift-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .gift-card {
        padding: 4px;
        border-radius: 8px;
    }

    .tree-preview-image {
        max-height: 80px;
    }

    .tree-topper-image {
        width: 24px;
        height: 24px;
        margin-bottom: -16px;
    }

    .tree-preview-card {
        padding: 8px;
    }

    .tree-owner-name {
        font-size: 11px;
    }

    .card-gift-circle {
        width: 50px;
        height: 50px;
    }

    .card-body {
        padding: 32px 10px 10px;
    }

    .card-from-input {
        font-size: 13px;
    }

    .card-message-input {
        min-height: 50px;
        font-size: 12px;
        padding: 6px 8px;
    }

    .primary-btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .card-send-btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .success-title {
        font-size: 18px;
    }

    .store-btn img {
        height: 32px;
    }

    .step-dot {
        width: 20px;
        height: 20px;
        font-size: 9px;
    }

    .step-line {
        width: 16px;
    }

    .download-step-number {
        width: 20px;
        height: 20px;
        min-width: 20px;
        font-size: 10px;
    }

    .download-step-title {
        font-size: 11px;
    }

    .download-step-desc {
        font-size: 10px;
    }

    .send-message-page .report-btn {
        font-size: 10px;
        padding: 3px 6px;
        gap: 3px;
    }

    .send-message-page .report-btn svg {
        width: 14px;
        height: 14px;
    }
}

/* ============================================
   21. Responsive - Safe Area (iPhone X+)
   ============================================ */
@supports (padding-top: env(safe-area-inset-top)) {
    .send-message-page .top-bar {
        padding-top: env(safe-area-inset-top);
        height: calc(60px + env(safe-area-inset-top));
    }

    .send-message-page .main-content {
        padding-bottom: calc(40px + env(safe-area-inset-bottom));
    }
}
