/* 
Eid Gift Ideas Generator - FULLY MOBILE OPTIMIZED
Pink & Purple Theme - Full Screen Mobile Display
*/

:root {
    --eid-pink: #ff4da6;
    --eid-pink-light: #ffb3d9;
    --eid-pink-dark: #e63e95;
    --eid-purple: #6a0dad;
    --eid-purple-light: #9b4dff;
    --eid-purple-dark: #4a0780;
    --eid-gradient: linear-gradient(135deg, #ff4da6 0%, #6a0dad 100%);
    --eid-gradient-hover: linear-gradient(135deg, #ff6bb5 0%, #7b1fa2 100%);
    --eid-white: #ffffff;
    --eid-light: #f8f9fa;
    --eid-shadow: 0 10px 30px rgba(106, 13, 173, 0.15);
    --eid-shadow-hover: 0 15px 40px rgba(106, 13, 173, 0.25);
    --eid-border-radius: 25px;
    --eid-border-radius-sm: 15px;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Main Container - FULL WIDTH on mobile */
.eid-gift-generator-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.eid-gift-container {
    width: 100%;
    background: var(--eid-gradient);
    border-radius: 0;
    padding: 20px 15px;
    position: relative;
    overflow: hidden;
    animation: fadeIn 1s ease-in-out;
    min-height: 100vh; /* Full viewport height on mobile */
    display: flex;
    flex-direction: column;
}

/* Floating Animation Elements */
.eid-gift-container::before {
    content: '🌙';
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 80px;
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
    z-index: 0;
}

.eid-gift-container::after {
    content: '🎁';
    position: absolute;
    bottom: 10px;
    left: 15px;
    font-size: 80px;
    opacity: 0.1;
    animation: float 6s ease-in-out infinite reverse;
    z-index: 0;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

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

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Header Section */
.eid-header {
    text-align: center;
    margin-bottom: 25px;
    position: relative;
    z-index: 2;
    padding: 10px 0;
}

.eid-icons {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.eid-icons span {
    font-size: 48px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.2));
}

.eid-icons span:first-child {
    animation-delay: 0.5s;
}

.eid-icons span:last-child {
    animation-delay: 1s;
}

.eid-title {
    color: var(--eid-white);
    font-size: 32px;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    font-weight: 700;
    line-height: 1.2;
    padding: 0 10px;
}

.eid-subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    margin: 0;
    padding: 0 15px;
    font-weight: 400;
}

/* Form Styles - FULL WIDTH Card */
.eid-gift-form {
    background: var(--eid-white);
    border-radius: var(--eid-border-radius);
    padding: 25px 20px;
    box-shadow: var(--eid-shadow);
    width: 100%;
    max-width: 100%;
    margin: 0 auto 20px;
    position: relative;
    z-index: 2;
    animation: slideUp 0.5s ease-out;
    border: 1px solid rgba(255,255,255,0.2);
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
    width: 100%;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.15s; }
.form-group:nth-child(3) { animation-delay: 0.2s; }
.form-group:nth-child(4) { animation-delay: 0.25s; }
.form-group:nth-child(5) { animation-delay: 0.3s; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--eid-purple);
    font-size: 15px;
    letter-spacing: 0.3px;
    padding-left: 5px;
}

/* Form Inputs - Touch Friendly */
.eid-input,
.eid-select {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid #f0f0f0;
    border-radius: var(--eid-border-radius-sm);
    font-size: 16px; /* Prevents zoom on mobile */
    transition: all 0.3s ease;
    background: var(--eid-white);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.02);
}

/* Custom select arrow */
.eid-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a0dad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 16px;
    padding-right: 50px;
}

.eid-input:focus,
.eid-select:focus {
    outline: none;
    border-color: var(--eid-pink);
    box-shadow: 0 0 0 4px rgba(255, 77, 166, 0.1);
}

.eid-input:hover,
.eid-select:hover {
    border-color: var(--eid-purple-light);
}

/* Generate Button - Large and Touch Friendly */
.eid-generate-btn {
    width: 100%;
    padding: 18px 20px;
    background: var(--eid-gradient);
    border: none;
    border-radius: 50px;
    color: var(--eid-white);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 15px;
    box-shadow: 0 8px 20px rgba(106, 13, 173, 0.3);
    letter-spacing: 0.5px;
    border: 1px solid rgba(255,255,255,0.2);
}

.eid-generate-btn:active {
    transform: scale(0.98);
    box-shadow: 0 4px 10px rgba(106, 13, 173, 0.4);
}

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

.eid-generate-btn:active::before {
    left: 100%;
}

/* Loader */
.eid-loader {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--eid-border-radius);
    backdrop-filter: blur(5px);
    margin: 20px 0;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.3);
    border-top: 6px solid var(--eid-white);
    border-right: 6px solid var(--eid-pink-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.eid-loader p {
    color: var(--eid-white);
    font-size: 18px;
    font-weight: 500;
    text-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Results Section - Full Width Cards */
.eid-results {
    width: 100%;
    background: transparent;
    margin-top: 20px;
    animation: slideUp 0.5s ease-out;
}

.result-section {
    background: var(--eid-white);
    border-radius: var(--eid-border-radius);
    padding: 25px 20px;
    margin-bottom: 20px;
    box-shadow: var(--eid-shadow);
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.2);
    width: 100%;
    animation: slideUp 0.5s ease-out forwards;
    opacity: 0;
}

.result-section:nth-child(1) { animation-delay: 0.1s; }
.result-section:nth-child(2) { animation-delay: 0.15s; }
.result-section:nth-child(3) { animation-delay: 0.2s; }
.result-section:nth-child(4) { animation-delay: 0.25s; }
.result-section:nth-child(5) { animation-delay: 0.3s; }

.result-section:active {
    transform: scale(0.99);
}

.result-section h2 {
    color: var(--eid-purple);
    font-size: 22px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--eid-gradient);
    border-radius: 4px;
}

/* Gift Ideas List */
.gift-ideas-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gift-ideas-list li {
    padding: 18px 15px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(255, 77, 166, 0.03), rgba(106, 13, 173, 0.03));
    border-radius: var(--eid-border-radius-sm);
    border-left: 6px solid var(--eid-pink);
    font-size: 16px;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease-out forwards;
    opacity: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    line-height: 1.5;
    word-break: break-word;
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateX(-15px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

.gift-ideas-list li:active {
    transform: scale(0.98);
    background: linear-gradient(135deg, rgba(255, 77, 166, 0.1), rgba(106, 13, 173, 0.1));
}

.gift-icon {
    font-size: 24px;
    min-width: 40px;
    text-align: center;
}

/* Gift Message Box */
.gift-message-box {
    background: var(--eid-gradient);
    color: var(--eid-white);
    padding: 25px 20px;
    border-radius: var(--eid-border-radius-sm);
    font-size: 17px;
    line-height: 1.7;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.1);
    word-break: break-word;
}

.gift-message-box::before {
    content: '💌';
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 60px;
    opacity: 0.1;
    transform: rotate(-10deg);
}

.message-tip {
    font-size: 14px;
    color: var(--eid-purple);
    margin-top: 15px;
    font-style: italic;
    text-align: center;
    background: rgba(106, 13, 173, 0.05);
    padding: 10px;
    border-radius: 50px;
}

/* Islamic Quote */
.islamic-quote {
    font-size: 18px;
    color: var(--eid-purple);
    font-style: italic;
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, rgba(255, 77, 166, 0.1), rgba(106, 13, 173, 0.1));
    border-radius: var(--eid-border-radius-sm);
    position: relative;
    line-height: 1.8;
    word-break: break-word;
}

.islamic-quote::before,
.islamic-quote::after {
    content: '"';
    font-size: 80px;
    color: var(--eid-pink);
    opacity: 0.2;
    position: absolute;
    font-family: serif;
}

.islamic-quote::before {
    top: -10px;
    left: 10px;
}

.islamic-quote::after {
    bottom: -30px;
    right: 10px;
}

/* Reasoning Section */
.reasoning-section {
    background: linear-gradient(135deg, rgba(255, 77, 166, 0.08), rgba(106, 13, 173, 0.08));
}

.reasoning-text {
    font-size: 16px;
    line-height: 1.8;
    padding: 15px;
    background: rgba(255,255,255,0.7);
    border-radius: var(--eid-border-radius-sm);
    border-left: 4px solid var(--eid-pink);
}

/* Gift Note */
.gift-note {
    font-style: italic;
    color: var(--eid-purple);
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(106, 13, 173, 0.05);
    border-radius: 50px;
    text-align: center;
    font-size: 15px;
}

/* Share Buttons Section */
.share-section {
    text-align: center;
    background: linear-gradient(135deg, rgba(255, 77, 166, 0.05), rgba(106, 13, 173, 0.05));
    border: 2px dashed var(--eid-purple-light);
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.share-btn {
    padding: 16px 10px;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    min-height: 55px; /* Touch friendly */
    border: 1px solid rgba(255,255,255,0.2);
}

.share-btn:active {
    transform: scale(0.96);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.share-btn i {
    font-size: 20px;
}

/* Individual button colors */
.share-btn.whatsapp {
    background: #25D366;
    background: linear-gradient(135deg, #25D366, #128C7E);
}

.share-btn.facebook {
    background: #1877F2;
    background: linear-gradient(135deg, #1877F2, #0D5AB9);
}

.share-btn.telegram {
    background: #0088cc;
    background: linear-gradient(135deg, #0088cc, #006699);
}

.share-btn.copy {
    background: var(--eid-gradient);
}

.share-btn.print {
    background: #6c757d;
    background: linear-gradient(135deg, #6c757d, #545b62);
}

/* Share hint */
.share-hint {
    font-size: 13px;
    color: var(--eid-purple);
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: rgba(255,255,255,0.7);
    padding: 10px;
    border-radius: 50px;
}

/* Error Message */
.eid-error {
    background: linear-gradient(135deg, #fff5f5, #ffe0e0);
    color: #dc3545;
    padding: 25px 20px;
    border-radius: var(--eid-border-radius);
    margin: 20px 0;
    text-align: center;
    border-left: 6px solid #dc3545;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    animation: shake 0.5s ease-in-out;
    font-size: 16px;
}

.error-icon {
    font-size: 32px;
}

/* Toast Notification */
.eid-toast {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    transform: translateY(100px);
    background: var(--eid-purple);
    color: white;
    padding: 16px 20px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(106, 13, 173, 0.4);
    z-index: 10000;
    font-size: 16px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 400px;
    margin: 0 auto;
}

.eid-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.eid-toast-success {
    background: linear-gradient(135deg, #28a745, #1e7e34);
}

/* Confetti */
.confetti {
    position: fixed;
    width: 12px;
    height: 12px;
    background: var(--eid-pink);
    top: -20px;
    border-radius: 50%;
    animation: confetti-fall linear forwards;
    z-index: 9999;
    pointer-events: none;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ========== MOBILE OPTIMIZATIONS ========== */

/* Extra Small Devices (Phones, 320px and up) */
@media (max-width: 480px) {
    .eid-gift-container {
        padding: 15px 12px;
    }
    
    .eid-title {
        font-size: 26px;
    }
    
    .eid-subtitle {
        font-size: 14px;
        padding: 0 10px;
    }
    
    .eid-icons span {
        font-size: 40px;
    }
    
    .eid-gift-form {
        padding: 20px 15px;
        border-radius: 20px;
    }
    
    .form-group label {
        font-size: 14px;
    }
    
    .eid-input,
    .eid-select {
        padding: 14px 15px;
        font-size: 15px;
    }
    
    .eid-select {
        background-position: right 12px center;
    }
    
    .eid-generate-btn {
        padding: 16px 15px;
        font-size: 17px;
    }
    
    .result-section {
        padding: 20px 15px;
    }
    
    .result-section h2 {
        font-size: 20px;
    }
    
    .gift-ideas-list li {
        padding: 15px 12px;
        font-size: 15px;
        gap: 10px;
    }
    
    .gift-icon {
        font-size: 20px;
        min-width: 30px;
    }
    
    .gift-message-box {
        font-size: 15px;
        padding: 20px 15px;
    }
    
    .islamic-quote {
        font-size: 16px;
        padding: 25px 15px;
    }
    
    .share-buttons {
        grid-template-columns: 1fr; /* Stack buttons on very small screens */
        gap: 10px;
    }
    
    .share-btn {
        padding: 14px;
        font-size: 14px;
        min-height: 50px;
    }
    
    .share-btn i {
        font-size: 18px;
    }
    
    .eid-toast {
        left: 15px;
        right: 15px;
        font-size: 14px;
        padding: 14px 18px;
    }
}

/* Small to Medium Devices (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .eid-gift-container {
        padding: 20px 15px;
    }
    
    .eid-title {
        font-size: 30px;
    }
    
    .eid-gift-form {
        padding: 25px 20px;
    }
    
    .share-buttons {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on tablets */
    }
    
    .share-btn.copy {
        grid-column: span 3;
    }
}

/* Tablets (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .eid-gift-container {
        padding: 30px 25px;
        border-radius: 30px;
        min-height: auto;
    }
    
    .eid-gift-form {
        max-width: 90%;
    }
    
    .share-buttons {
        grid-template-columns: repeat(5, 1fr); /* All 5 in a row on tablets */
    }
}

/* Desktop (1025px and up) */
@media (min-width: 1025px) {
    .eid-gift-container {
        padding: 40px;
        border-radius: 30px;
        min-height: auto;
    }
    
    .eid-gift-form {
        max-width: 800px;
    }
    
    .share-buttons {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .share-btn {
        flex: 0 1 auto;
        min-width: 140px;
    }
}

/* Landscape Mode Optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .eid-gift-container {
        min-height: auto;
        padding: 15px;
    }
    
    .eid-header {
        margin-bottom: 15px;
    }
    
    .eid-icons span {
        font-size: 36px;
    }
    
    .eid-title {
        font-size: 24px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .eid-gift-form {
        padding: 15px;
    }
}

/* High Resolution Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .eid-gift-container {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .eid-input,
    .eid-select,
    .eid-generate-btn,
    .share-btn,
    .gift-ideas-list li {
        cursor: default;
        -webkit-tap-highlight-color: rgba(106, 13, 173, 0.1);
    }
    
    .eid-generate-btn:hover {
        transform: none;
    }
    
    .share-btn:hover {
        transform: none;
    }
    
    .gift-ideas-list li:hover {
        transform: none;
    }
}

/* Dark Mode Support (if enabled by device) */
@media (prefers-color-scheme: dark) {
    .eid-gift-form,
    .result-section {
        background: rgba(255, 255, 255, 0.98);
    }
}

/* Print Styles */
@media print {
    .eid-gift-form,
    .eid-generate-btn,
    .share-buttons,
    .share-hint,
    .message-tip,
    .eid-header .eid-icons,
    .eid-toast,
    .confetti {
        display: none !important;
    }
    
    .eid-gift-container {
        background: white !important;
        min-height: auto;
        padding: 20px;
    }
    
    .eid-title {
        color: black !important;
    }
    
    .eid-subtitle {
        color: #333 !important;
    }
    
    .eid-results {
        display: block !important;
    }
    
    .result-section {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
        background: white !important;
    }
    
    .gift-message-box {
        background: #f5f5f5 !important;
        color: black !important;
        border: 1px solid #ccc;
    }
    
    .islamic-quote {
        color: #333 !important;
        background: #f9f9f9 !important;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Fix for iOS input zoom */
@supports (-webkit-touch-callout: none) {
    .eid-input,
    .eid-select,
    .eid-generate-btn,
    .share-btn {
        font-size: 16px !important;
    }
}

/* Safe area insets for modern phones */
@supports (padding: max(0px)) {
    .eid-gift-container {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
        padding-top: max(15px, env(safe-area-inset-top));
        padding-bottom: max(15px, env(safe-area-inset-bottom));
    }
    
    .eid-toast {
        bottom: max(20px, env(safe-area-inset-bottom));
    }
}