/* ==========================================
   BRUNO MOTIVATION APP - MAIN STYLES
   Apple Mini App - HTML5/CSS3
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* Color palette - RGB(253, 243, 215) creamy beige background */
    --bg-primary: #FDF3D7;
    --bg-secondary: #FDF3D7;
    --text-primary: #2C2624;
    --text-secondary: #6B5D52;
    --green-primary: #555555;
    --green-secondary: #e0d45d;
    --green-hover: #fff3ab;
    --white: #FFFFFF;
    --shadow: rgba(0, 0, 0, 0.15);
    --shadow-hover: rgba(0, 0, 0, 0.25);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* iOS Safe Area Support */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* ==========================================
   SCREEN TRANSITIONS
   ========================================== */

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================
   WELCOME SCREEN
   ========================================== */

#welcomeScreen {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--bg-primary);
}

.welcome-container {
    text-align: center;
    animation: fadeInScale 1s ease-out;
    position: relative;
}

.tap-to-continue {
    margin-top: 40px;
    font-size: 18px;
    color: var(--text-secondary);
    opacity: 0;
    animation: fadeInPulse 2s ease-in-out 1s infinite;
    font-weight: 500;
}

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

.bruno-image {
    max-width: 80%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.15));
    animation: float 3s ease-in-out infinite;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* ==========================================
   MAIN SCREEN
   ========================================== */

#mainScreen {
    overflow-y: auto;
    background: var(--bg-primary);
}

.main-container {
    margin: 0 auto;
    width: 100%;
    min-height: 100vh;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header Image */
.header-image-container {
    width: 100%;
    max-width: clamp(320px, 85%, 600px);
    margin-bottom: 1.5rem;
    animation: slideDown 0.8s ease-out;
}

.motivation-image {
    width: 100%;
    max-height: 240px;
    object-fit: contain;
    display: block;
    border-radius: 24px;
    box-shadow: 0 15px 40px var(--shadow);
}

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

/* Greeting Text */
.greeting-text {
    width: 100%;
    max-width: clamp(320px, 85%, 600px);
    margin-bottom: 1.5rem;
    animation: fadeIn 1s ease-out 0.3s both;
}

.greeting-main {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
    text-align: center;
}

.greeting-sub {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

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

/* ==========================================
   ACTION BUTTONS
   ========================================== */

.buttons-container {
    width: 100%;
    max-width: clamp(320px, 85%, 600px);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 20px;
    padding-bottom: 1.5rem;
}

.action-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    border: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--white);
    background: linear-gradient(135deg, var(--green-primary) 0%, var(--green-secondary) 100%);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px var(--shadow);
}

/* Initial hidden state for main menu buttons only */
.buttons-container .action-button {
    opacity: 0;
    transform: translateY(60px) scale(0.95);
}

.action-button:hover {
    background: linear-gradient(135deg, var(--green-hover) 0%, var(--green-primary) 100%);
    box-shadow: 0 12px 30px var(--shadow-hover);
    transform: translateY(-2px);
}

/* Animated state - triggered when main screen becomes active */
.main-container.animate .action-button {
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Individual delays for sequential appearance */
.main-container.animate .quote-button {
    animation-delay: 0.2s;
}

.main-container.animate .affirmation-button {
    animation-delay: 0.3s;
}

.main-container.animate .message-button {
    animation-delay: 0.4s;
}

.main-container.animate .ideas-button {
    animation-delay: 0.5s;
}

.action-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.action-button:hover::before,
.action-button:active::before {
    opacity: 1;
}

.action-button:active {
    transform: scale(0.97);
}

/* Individual button classes removed - all styles now in .action-button above */

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

/* Button Content */
.button-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.button-text {
    flex-shrink: 0;
}

.button-arrow {
    font-size: 24px;
    font-weight: bold;
    flex-shrink: 0;
    margin-left: auto;
    transition: transform 0.3s ease;
}

.action-button:hover .button-arrow {
    transform: translateX(5px);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 480px) {
    .main-container,
    .messages-container,
    .affirmations-container,
    .quotes-container,
    .ideas-container {
        padding: 1rem;
    }

    .greeting-main {
        font-size: 16px;
    }

    .greeting-sub {
        font-size: 14px;
    }

    .action-button {
        padding: 12px 18px;
        font-size: 16px;
    }

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

    .button-arrow {
        font-size: 20px;
    }

    .messages-description p,
    .affirmations-description p,
    .quotes-description p {
        font-size: 18px;
    }

    .ideas-description p {
        font-size: 16px;
    }

    .message-display-box,
    .affirmation-display-box,
    .quote-display-box,
    .idea-display-box {
        padding: 1.5rem;
        min-height: 120px;
    }

    .message-text,
    .affirmation-text,
    .quote-text,
    .idea-text {
        font-size: 16px;
    }

    .messages-buttons,
    .affirmations-buttons,
    .quotes-buttons,
    .ideas-buttons {
        gap: 0.75rem;
    }

    .back-button {
        padding: 12px 18px;
        font-size: 16px;
    }
}

@media (min-width: 768px) {
    .main-container,
    .messages-container,
    .affirmations-container,
    .quotes-container,
    .ideas-container {
        padding: 2.5rem 1.25rem;
    }
}

/* ==========================================
   MESSAGES SCREEN
   ========================================== */

#messagesScreen {
    overflow-y: auto;
    background: var(--bg-primary);
}

.messages-container {
    width: 100%;
    min-height: 100vh;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Shared styles for all content screens */
.messages-header-image-container,
.affirmations-header-image-container,
.quotes-header-image-container,
.ideas-header-image-container {
    width: 100%;
    max-width: clamp(320px, 85%, 600px);
    margin-bottom: 1rem;
    animation: slideDown 0.8s ease-out;
}

.messages-header-image,
.affirmations-header-image,
.quotes-header-image,
.ideas-header-image {
    width: 100%;
    max-height: 240px;
    object-fit: contain;
    display: block;
    border-radius: 24px;
    box-shadow: 0 15px 40px var(--shadow);
}

.messages-description,
.affirmations-description,
.quotes-description,
.ideas-description {
    width: 100%;
    max-width: clamp(320px, 85%, 600px);
    text-align: center;
    margin-bottom: 1rem;
    animation: fadeIn 0.5s ease-out 0.3s both;
}

.messages-description p,
.affirmations-description p,
.quotes-description p {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.6;
}

.ideas-description p {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.6;
}

.message-display-box,
.affirmation-display-box,
.quote-display-box,
.idea-display-box {
    width: 100%;
    max-width: clamp(320px, 85%, 600px);
    background: white;
    border-radius: 20px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 10px 30px var(--shadow);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.6s ease-out 0.5s both;
}

.message-text,
.affirmation-text,
.quote-text,
.idea-text {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.8;
    text-align: center;
}

.messages-buttons,
.affirmations-buttons,
.quotes-buttons,
.ideas-buttons {
    width: 100%;
    max-width: clamp(320px, 85%, 600px);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    padding-bottom: 2rem;
    animation: slideUp 0.3s ease-out 0.3s both;
}

/* ==========================================
   AFFIRMATIONS SCREEN
   ========================================== */

#affirmationsScreen {
    overflow-y: auto;
    background: var(--bg-primary);
}

.affirmations-container {
    width: 100%;
    min-height: 100vh;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Styles moved to shared section above */

/* ==========================================
   QUOTES SCREEN
   ========================================== */

#quotesScreen {
    overflow-y: auto;
    background: var(--bg-primary);
}

.quotes-container {
    width: 100%;
    min-height: 100vh;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Styles moved to shared section above */

/* ==========================================
   IDEAS SCREEN
   ========================================== */

#ideasScreen {
    overflow-y: auto;
    background: var(--bg-primary);
}

.ideas-container {
    width: 100%;
    min-height: 100vh;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Styles moved to shared section above */

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* .secondary-button removed - using .action-button instead */

.back-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    border: 2px solid var(--green-primary);
    border-radius: 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--green-primary);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-button:hover {
    background: var(--green-primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--shadow);
}

.back-button:active {
    transform: scale(0.97);
}

/* ==========================================
   TOUCH FEEDBACK
   ========================================== */

@media (hover: none) and (pointer: coarse) {
    .action-button:active {
        transform: scale(0.95);
        box-shadow: 0 6px 15px var(--shadow);
    }
    
    .back-button:active {
        transform: scale(0.95);
    }
}

/* ==========================================
   APPLE DEVICES OPTIMIZATION
   Mini App Partner Program Requirements
   ========================================== */

/* iPhone SE / Small devices (320px - 374px) */
@media (max-width: 374px) {
    .main-container,
    .messages-container,
    .affirmations-container,
    .quotes-container,
    .ideas-container {
        padding: 0.75rem;
    }
    
    .motivation-image,
    .messages-header-image,
    .affirmations-header-image,
    .quotes-header-image,
    .ideas-header-image {
        max-height: 170px;
    }
    
    .greeting-main {
        font-size: 15px;
    }
    
    .greeting-sub {
        font-size: 13px;
    }
    
    .buttons-container,
    .messages-buttons,
    .affirmations-buttons,
    .quotes-buttons,
    .ideas-buttons {
        gap: 0.75rem;
    }
    
    /* Shared content screen elements */
    .messages-description p,
    .affirmations-description p,
    .quotes-description p {
        font-size: 18px;
    }

    .ideas-description p {
        font-size: 16px;
    }

    .message-display-box,
    .affirmation-display-box,
    .quote-display-box,
    .idea-display-box {
        padding: 1.5rem;
        min-height: 120px;
    }

    .message-text,
    .affirmation-text,
    .quote-text,
    .idea-text {
        font-size: 16px;
    }

    .messages-buttons,
    .affirmations-buttons,
    .quotes-buttons,
    .ideas-buttons {
        gap: 0.75rem;
    }
    
    .action-button {
        padding: 10px 16px;
        font-size: 15px;
    }
    
    .button-icon {
        font-size: 18px;
    }
}

/* No need for specific iPhone size media queries - clamp() handles it */

/* iPad and larger tablets */
@media (min-width: 768px) {
    .motivation-image,
    .messages-header-image,
    .affirmations-header-image,
    .quotes-header-image,
    .ideas-header-image {
        max-height: 300px;
    }
    
    .greeting-main {
        font-size: 20px;
    }
    
    .greeting-sub {
        font-size: 18px;
    }
    
    .action-button {
        padding: 16px 24px;
        font-size: 19px;
    }
}

/* iPad Pro / Large tablets */
@media (min-width: 1024px) {
    .motivation-image,
    .messages-header-image,
    .affirmations-header-image,
    .quotes-header-image,
    .ideas-header-image {
        max-height: 350px;
    }
    
    .greeting-main {
        font-size: 22px;
    }
    
    .greeting-sub {
        font-size: 19px;
    }
    
    .action-button {
        padding: 16px 24px;
        font-size: 20px;
    }
    
    .button-icon {
        font-size: 26px;
    }
}

/* Landscape orientation for iPhone */
@media (max-height: 450px) and (orientation: landscape) {
    .main-container {
        padding: 12px 20px;
    }
    
    .header-image-container {
        margin-bottom: 10px;
    }
    
    .motivation-image {
        max-height: 120px;
    }
    
    .greeting-text {
        margin-bottom: 8px;
    }
    
    .greeting-main {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .greeting-sub {
        font-size: 13px;
    }
    
    .buttons-container {
        gap: 10px;
        padding-bottom: 20px;
    }
    
    .action-button {
        padding: 8px 16px;
        font-size: 15px;
    }
}

/* Landscape for iPad */
@media (min-width: 768px) and (orientation: landscape) {
    .main-container {
        max-width: 900px;
    }
    
    .buttons-container {
        max-width: 600px;
    }
}

/* ==========================================
   PREMIUM MODAL
   ========================================== */

.premium-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.premium-modal.active {
    opacity: 1;
    visibility: visible;
}

.premium-modal.active .premium-modal-content {
    transform: scale(1);
    opacity: 1;
}

.premium-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.premium-modal-content {
    position: relative;
    background: linear-gradient(135deg, #FFFFFF 0%, #F8F9FA 100%);
    border-radius: 30px;
    padding: 40px 30px;
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4);
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    z-index: 10000;
}

.premium-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 28px;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.premium-close-btn:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.premium-icon {
    font-size: 60px;
    text-align: center;
    margin-bottom: 20px;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.1) rotate(10deg);
        filter: brightness(1.3);
    }
}

.premium-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 15px;
    line-height: 1.3;
}

.premium-description {
    font-size: 17px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 35px;
    line-height: 1.7;
}

/* Premium features removed - keeping minimal styling */

.premium-price {
    text-align: center;
    margin-bottom: 20px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 193, 7, 0.15) 100%);
    border-radius: 16px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.price-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.price-period {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-left: 4px;
}

.premium-upgrade-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    border: none;
    border-radius: 16px;
    font-size: 17px;
    font-weight: 700;
    color: var(--white);
    background: linear-gradient(135deg, #FF6B35 0%, #FF8F5F 50%, #FF6B35 100%);
    background-size: 200% auto;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.35);
    position: relative;
    overflow: hidden;
}

.premium-upgrade-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;
}

.premium-upgrade-btn:hover {
    background-position: right center;
    box-shadow: 0 15px 40px rgba(255, 107, 53, 0.5);
    transform: translateY(-2px) scale(1.02);
}

.premium-upgrade-btn:hover::before {
    left: 100%;
}

.premium-upgrade-btn:active {
    transform: scale(0.98);
}

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

.btn-text {
    font-size: 17px;
    font-weight: 700;
}

.premium-note {
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 20px;
    opacity: 0.8;
}

/* Premium Modal Responsive Styles */

@media (max-width: 480px) {
    .premium-modal-content {
        padding: 30px 20px;
        border-radius: 25px;
    }
    
    .premium-icon {
        font-size: 50px;
    }
    
    .premium-title {
        font-size: 20px;
    }
    
    .premium-description {
        font-size: 15px;
        margin-bottom: 25px;
    }
    
    .premium-price {
        padding: 10px 16px;
    }
    
    .price-amount {
        font-size: 24px;
    }
    
    .price-period {
        font-size: 14px;
    }
    
    .premium-upgrade-btn {
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .btn-icon {
        font-size: 18px;
    }
    
    .btn-text {
        font-size: 16px;
    }
}

@media (min-width: 768px) {
    .premium-modal-content {
        max-width: 480px;
        padding: 40px 35px;
    }
    
    .premium-title {
        font-size: 24px;
    }
    
    .premium-description {
        font-size: 17px;
        margin-bottom: 30px;
    }
}

/* All shared styles have been consolidated above */
