* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Ghibli-inspired fonts */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&family=Quicksand:wght@400;500;600;700&display=swap');

body {
    font-family: 'Nunito', sans-serif;
    line-height: 1.6;
    background-color: #e6f0ed; /* Soft Ghibli green */
    color: #4a5568;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23aad4c8' fill-opacity='0.2' fill-rule='evenodd'/%3E%3C/svg%3E");
    background-attachment: fixed;
}
 
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

header {
    margin-bottom: 2rem;
    text-align: center;
}

h1 {
    font-family: 'Quicksand', sans-serif;
    color: #5a7d7c; /* Ghibli teal */
    margin-bottom: 1rem;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.05);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
}

h1:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #7ea9a7, transparent);
}

main {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(138, 168, 158, 0.2);
    padding: 2rem;
    width: 100%;
    max-width: 550px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.form-group {
    margin-bottom: 1.8rem;
}

input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #c5d6d0;
    border-radius: 15px;
    font-size: 16px;
    font-family: 'Nunito', sans-serif;
    transition: all 0.3s;
    background-color: rgba(255, 255, 255, 0.8);
    color: #5a7d7c;
}

input[type="text"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(126, 169, 167, 0.2);
    border-color: #7ea9a7;
    background-color: #fff;
}

.btn {
    background-color: #7ea9a7; /* Ghibli teal */
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
    transition: all 0.3s;
    width: 100%;
    box-shadow: 0 4px 15px rgba(126, 169, 167, 0.3);
    letter-spacing: 0.5px;
}

.btn:hover {
    background-color: #6a9491;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(126, 169, 167, 0.4);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(126, 169, 167, 0.3);
}

.hidden {
    display: none;
}

h2 {
    margin-bottom: 1.8rem;
    text-align: center;
    font-family: 'Quicksand', sans-serif;
    color: #5a7d7c;
    font-weight: 600;
}

h3 {
    font-family: 'Quicksand', sans-serif;
    color: #5a7d7c;
    font-weight: 600;
}

#welcome-screen {
    text-align: center;
}

#user-name {
    color: #eb6e80; /* Ghibli pink */
    font-weight: 700;
    position: relative;
    padding: 0 4px;
}

#user-name:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(235, 110, 128, 0.3); /* Light Ghibli pink */
    border-radius: 3px;
}
 
.secondary-btn {
    background-color: rgba(255, 255, 255, 0.9);
    color: #7ea9a7;
    border: 1px solid #c5d6d0;
    padding: 10px 18px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    transition: all 0.3s;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(122, 153, 151, 0.1);
}

.secondary-btn:hover {
    background-color: rgba(255, 255, 255, 1);
    border-color: #7ea9a7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(122, 153, 151, 0.2);
}

.install-info {
    margin-top: 30px;
    border-top: 1px solid #e2eceb;
    padding-top: 20px;
    text-align: center;
}

#install-instructions {
    margin-top: 15px;
    padding: 20px;
    border-radius: 18px;
    background-color: rgba(245, 250, 249, 0.8);
    border: 1px solid #d5e6e3;
}

#install-instructions h3 {
    margin-bottom: 15px;
    color: #5a7d7c;
}

.device-instructions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.device-section h4 {
    margin-bottom: 12px;
    font-weight: 600;
    color: #eb6e80;
    font-family: 'Quicksand', sans-serif;
}

.device-section ol {
    padding-left: 10px;
    list-style-position: inside;
}

.device-section li {
    margin-bottom: 10px;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.device-section li:hover {
    background-color: #fff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

@media (min-width: 768px) {
    .device-instructions {
        flex-direction: row;
        gap: 40px;
    }
    
    .device-section {
        flex: 1;
    }
}

/* Friend Time Zone Feature Styles */
.friends-section {
    margin-top: 30px;
    text-align: left;
}

.friends-section h3 {
    margin-bottom: 25px;
    color: #5a7d7c;
    text-align: center;
    font-size: 1.4rem;
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
}

.friends-section h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #7ea9a7, transparent);
}

.friends-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.friend-card {
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 5px 15px rgba(126, 169, 167, 0.15);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.4s ease;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
}

.friend-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(126, 169, 167, 0.25);
    background-color: #fff;
}

.friend-card h4 {
    margin-bottom: 10px;
    color: #5a7d7c;
    font-family: 'Quicksand', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Fix delete button position to be in top-right corner */
.delete-friend {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(235, 110, 128, 0.1);
    color: #eb6e80;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s;
    transform: scale(0.8);
    z-index: 5; /* Ensure it's above other elements */
}

.friend-card:hover .delete-friend {
    opacity: 1;
    transform: scale(1);
}

.delete-friend:hover {
    background-color: rgba(235, 110, 128, 0.2);
    transform: rotate(90deg);
}

/* Friend activity styles - updated for side-by-side layout */
.friend-activity {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Space between activity and time */
    margin-bottom: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 8px 12px;
    border-radius: 15px;
    backdrop-filter: blur(2px);
    transition: all 0.3s ease;
}

.activity-left {
    display: flex;
    align-items: center;
}

.activity-icon {
    font-size: 1.6rem;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: gentle-bounce 2s infinite ease-in-out;
}

.activity-description {
    color: #5a7d7c;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
}

/* Updated time styling to fit inside activity bar */
.friend-time {
    font-size: 1.3rem;
    font-weight: 700;
    color: #eb6e80; /* Ghibli pink */
    font-family: 'Quicksand', sans-serif;
    position: relative;
    display: inline-block;
    letter-spacing: -0.5px;
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid rgba(126, 169, 167, 0.2);
}

/* Remove the star symbol since we've moved the time */
.friend-time:before {
    content: none;
}

/* City info styles - removed background */
.friend-city {
    color: #7a9997;
    font-size: 15px;
    padding: 6px 12px 6px 0;
    border-radius: 0;
    display: inline-block;
    background-color: transparent;
    letter-spacing: 0.3px;
    margin-top: -5px;
    margin-bottom: 5px;
}

/* Activity-specific styling */
.activity-sleeping .friend-activity {
    background-color: rgba(42, 72, 120, 0.1);
    border-left: 3px solid rgba(42, 72, 120, 0.5);
}

.activity-waking .friend-activity {
    background-color: rgba(235, 165, 76, 0.1);
    border-left: 3px solid rgba(235, 165, 76, 0.5);
}

.activity-breakfast .friend-activity {
    background-color: rgba(235, 165, 76, 0.1);
    border-left: 3px solid rgba(235, 165, 76, 0.5);
}

.activity-working .friend-activity {
    background-color: rgba(98, 178, 208, 0.1);
    border-left: 3px solid rgba(98, 178, 208, 0.5);
}

.activity-lunch .friend-activity {
    background-color: rgba(126, 169, 167, 0.1);
    border-left: 3px solid rgba(126, 169, 167, 0.5);
}

.activity-evening .friend-activity,
.activity-movie .friend-activity {
    background-color: rgba(235, 110, 128, 0.1);
    border-left: 3px solid rgba(235, 110, 128, 0.5);
}

.activity-dinner .friend-activity {
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 3px solid rgba(255, 193, 7, 0.5);
}

.activity-weekend .friend-activity {
    background-color: rgba(156, 39, 176, 0.1);
    border-left: 3px solid rgba(156, 39, 176, 0.5);
}

/* Friend stats counter styling */
.friend-stats {
    background-color: rgba(255, 255, 255, 0.75);
    border-radius: 16px;
    padding: 10px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(126, 169, 167, 0.1);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    color: #eb6e80;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: #5a7d7c;
    font-weight: 600;
}

.stat-divider {
    color: #c5d6d0;
    font-size: 1.5rem;
    line-height: 1;
    padding-top: 4px;
    margin-bottom: 17px;
}

/* Animation for activity icons */
@keyframes gentle-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .friend-activity {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .friend-time {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        margin-top: 8px;
        font-size: 1.2rem;
    }
}

/* Mobile responsiveness adjustments */
@media (max-width: 480px) {
    .floating-action-btn {
        bottom: 25px;
        right: 25px;
        width: 50px;
        height: 50px;
    }
    
    .plus-icon {
        font-size: 24px;
    }
    
    .friend-time {
        font-size: 28px;
    }
    
    h1 {
        font-size: 2rem;
    }
}

/* Floating Action Button styles - ensure visibility with higher specificity */
.floating-action-btn {
    position: fixed !important;
    bottom: 35px !important;
    right: 35px !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    background-color: #eb6e80 !important; /* Ghibli pink */
    color: white !important;
    border: none !important;
    box-shadow: 0 5px 20px rgba(235, 110, 128, 0.4) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.4s ease !important;
    z-index: 999 !important; /* Much higher z-index to guarantee visibility */
    font-size: 30px !important;
    font-weight: 400 !important;
    text-align: center !important;
    line-height: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.floating-action-btn:hover {
    background-color: #e05c70;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(235, 110, 128, 0.5);
}

.floating-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 15px rgba(235, 110, 128, 0.4);
}

.plus-icon {
    display: inline-block;
    font-size: 32px;
    line-height: 0;
}

/* Ghibli-inspired animations */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

@keyframes gentle-glow {
    0%, 100% { 
        text-shadow: 0 0 5px rgba(235, 110, 128, 0.1),
                     0 0 10px rgba(235, 110, 128, 0.05); 
    }
    50% { 
        text-shadow: 0 0 8px rgba(235, 110, 128, 0.2),
                    0 0 15px rgba(235, 110, 128, 0.1); 
    }
}

/* Apply animations */
.friend-time {
    animation: gentle-glow 3s infinite ease-in-out;
}

/* Fix friend form modal to display properly */
.friend-form {
    background-color: #fff !important;
    border-radius: 24px !important;
    padding: 28px !important;
    box-shadow: 0 15px 40px rgba(90, 125, 124, 0.3) !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90% !important;
    max-width: 450px !important;
    z-index: 2000 !important; /* Use very high z-index to ensure it's on top */
    max-height: 80vh !important;
    overflow-y: auto !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    /* display: block; */
    margin: 0 !important;
}

.friend-flag{
    padding: 3px;
}

/* Ensure proper overlay display */
.form-overlay {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-color: rgba(90, 125, 124, 0.25) !important;
    z-index: 1999 !important; /* Just below the form but above everything else */
    backdrop-filter: blur(1px) !important;
    cursor: pointer !important; /* Show pointer cursor on overlay */
}

.form-overlay.active {
    display: block !important;
}

/* Fix form group styling in the modal */
.friend-form .form-group {
    margin-bottom: 20px !important;
    position: relative !important;
}

.friend-form h4 {
    margin-bottom: 22px !important;
    text-align: center !important;
    font-family: 'Quicksand', sans-serif !important;
    color: #5a7d7c !important;
    font-size: 1.6rem !important;
    font-weight: 600 !important;
}

.friend-form label {
    display: block !important;
    margin-bottom: 8px !important;
    font-weight: 600 !important;
    color: #5a7d7c !important;
    font-size: 15px !important;
}

/* Fix form actions */
.friend-form .form-actions {
    display: flex !important;
    justify-content: space-between !important;
    gap: 15px !important;
    margin-top: 25px !important;
}

.friend-form .form-actions button {
    flex: 1 !important;
    padding: 14px 0 !important;
}

.friend-form .form-actions .secondary-btn {
    margin-top: 0 !important;
}

/* Fix suggestions container */
#city-suggestions {
    position: absolute !important;
    background-color: #fff !important;
    border: 1px solid #d5e6e3 !important;
    border-radius: 15px !important;
    max-height: 200px !important;
    overflow-y: auto !important;
    z-index: 2001 !important; /* Higher than form */
    width: 100% !important;
    box-shadow: 0 10px 25px rgba(90, 125, 124, 0.2) !important;
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 20px;
    margin-top: auto; /* Pushes footer to bottom if content is short */
    background-color: rgba(255, 255, 255, 0.7);
    border-top: 1px solid #e2eceb;
    font-size: 0.9rem;
    color: #5a7d7c;
    width: 100%;
}

footer p {
    margin-bottom: 8px;
}

footer nav a {
    color: #7ea9a7;
    text-decoration: none;
    margin: 0 8px;
    transition: color 0.3s ease;
}

footer nav a:hover {
    color: #eb6e80; /* Ghibli pink for hover */
    text-decoration: underline;
}
