/* Lindsay's Homepage - Mobile First Design */

:root {
    --primary-color: #8B4513; /* Saddle brown */
    --secondary-color: #90EE90; /* Pasture green */
    --accent-color: #DAA520; /* Golden hay */
    --text-dark: #333;
    --text-light: #666;
    --white: #FFFFFF;
    --chestnut: #954535; /* Horse chestnut */
    --sky-blue: #87CEEB; /* Clear sky */
    --cream: #FFFDD0; /* Soft cream */
    --fence-brown: #6B4423; /* Fence wood */
    --shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
    --shadow-hover: 0 8px 25px rgba(139, 69, 19, 0.5);
    --border-radius: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(to bottom, var(--sky-blue) 0%, var(--secondary-color) 60%, #8FBC8F 100%);
    min-height: 100vh;
    color: var(--text-dark);
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
}

/* Pasture decorations */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(8px 8px at 20px 30px, var(--accent-color), transparent),
        radial-gradient(6px 6px at 80px 60px, var(--chestnut), transparent),
        radial-gradient(8px 8px at 150px 40px, var(--accent-color), transparent),
        radial-gradient(6px 6px at 220px 80px, var(--chestnut), transparent),
        radial-gradient(8px 8px at 300px 50px, var(--accent-color), transparent);
    background-repeat: repeat;
    background-size: 350px 100px;
    z-index: -2;
}

.container {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 100px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 32px;
    color: var(--white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.greeting {
    font-size: 18px;
    color: var(--white);
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    display: inline-block;
}

/* Starlight Featured Card */
.starlight-featured {
    background: linear-gradient(135deg, var(--accent-color), var(--cream));
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 25px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.starlight-featured:hover {
    box-shadow: var(--shadow-hover);
    background: linear-gradient(135deg, var(--cream), var(--accent-color));
}

.starlight-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.starlight-content h2 {
    font-size: 22px;
    color: var(--text-dark);
    margin: 0 0 5px 0;
    font-weight: 700;
}

.starlight-content p {
    font-size: 16px;
    color: var(--text-dark);
    margin: 0;
    opacity: 0.8;
}

/* App Grid */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    padding: 10px;
}

.card {
    background: linear-gradient(145deg, rgba(255, 253, 208, 0.95), rgba(255, 255, 255, 0.9));
    backdrop-filter: blur(10px);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 25px 15px;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(139, 69, 19, 0.1), rgba(144, 238, 144, 0.1), transparent);
    opacity: 0;
}

.card:hover {
    box-shadow: var(--shadow-hover), 0 0 20px rgba(139, 69, 19, 0.3);
    border-color: var(--chestnut);
}

.card:hover::before {
    opacity: 1;
}

.card-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.card span {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

/* Sunshine Chat Bubble */
.sunshine-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary-color), #FFE55C);
    color: var(--text-dark);
    padding: 15px 20px;
    border-radius: 30px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-hover);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
}

.sunshine-bubble:hover {
    background: #FFE55C;
}

.bubble-icon {
    font-size: 24px;
}

.bubble-text {
    font-weight: 600;
    font-size: 14px;
}

/* Chat Window */
.chat-window {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100vh;
    width: 100vw;
    background: linear-gradient(180deg, var(--cream), rgba(255, 255, 255, 0.95));
    backdrop-filter: blur(15px);
    z-index: 2000;
    flex-direction: column;
    display: none;
}

.chat-window.active {
    display: flex;
}

.chat-header {
    background: linear-gradient(135deg, var(--primary-color), var(--chestnut));
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(139, 69, 19, 0.2);
    gap: 15px;
}

.chat-header span {
    font-size: 20px;
    font-weight: 700;
    color: var(--white);
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    color: white;
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(to bottom, var(--cream), var(--white));
}

.message {
    margin-bottom: 15px;
    display: flex;
}

.message.user {
    justify-content: flex-end;
}

.message.sunshine {
    justify-content: flex-start;
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 16px;
    line-height: 1.4;
}

.message.user .message-content {
    background: var(--secondary-color);
    color: var(--text-dark);
}

.message.sunshine .message-content {
    background: var(--accent-color);
    color: var(--text-dark);
    border: 1px solid var(--primary-color);
}

.chat-input-container {
    padding: 15px;
    background: var(--white);
    border-top: 1px solid #E0E0E0;
    display: flex;
    gap: 10px;
    align-items: center;
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--secondary-color);
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    background: var(--white);
    -webkit-appearance: none;
    appearance: none;
}

.chat-input:focus {
    border-color: var(--primary-color);
}

.send-btn {
    background: var(--primary-color);
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
}

.send-btn:hover {
    background: var(--chestnut);
    color: var(--white);
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, var(--sky-blue), var(--secondary-color));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.loading-screen.hidden {
    display: none;
}

.loader {
    font-size: 64px;
}

.loading-screen p {
    margin-top: 20px;
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 500;
}

/* Removed old starlight card styles - now using featured card */

/* Mobile keyboard adjustments */
@media (max-height: 500px) {
    .chat-window {
        height: 100vh;
        padding-bottom: env(keyboard-inset-height, 0);
    }
    
    .chat-messages {
        padding-bottom: 20px;
    }
}

/* iOS Safari keyboard fix */
@supports (-webkit-touch-callout: none) {
    .chat-window.keyboard-open {
        height: calc(100vh - env(keyboard-inset-height, 0px));
    }
    
    .chat-input-container {
        padding-bottom: calc(15px + env(safe-area-inset-bottom, 0px));
    }
}

/* Responsive Design */
@media (min-width: 768px) {
    .container {
        padding: 40px;
    }
    
    .app-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
    
    .chat-window {
        width: 450px;
        right: 20px;
        left: auto;
        bottom: 20px;
        height: 600px;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow-hover);
    }
}

/* PWA Styles */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
    }
    
    .container {
        padding-bottom: calc(100px + env(safe-area-inset-bottom));
    }
}

/* Ranch Elements - Simplified */
.ranch-element {
    position: fixed;
    border-radius: 50%;
    z-index: -1;
    opacity: 0.6;
}

.hay-bale-1 {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle at 30% 30%, var(--accent-color), var(--fence-brown));
    top: 10%;
    right: 10%;
    border-radius: 20px;
}

.hay-bale-2 {
    width: 25px;
    height: 25px;
    background: radial-gradient(circle at 30% 30%, var(--accent-color), var(--primary-color));
    top: 60%;
    left: 5%;
    border-radius: 15px;
}

.hay-bale-3 {
    width: 35px;
    height: 35px;
    background: radial-gradient(circle at 30% 30%, var(--chestnut), var(--primary-color));
    bottom: 20%;
    right: 15%;
    border-radius: 18px;
}

/* Shooting stars removed for cleaner interface */

/* Nebulas removed for cleaner interface */

.constellation {
    position: fixed;
    z-index: -1;
}

.constellation-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.3), transparent);
    transform-origin: left center;
}

