/* Import funky font */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --primary: #3A86FF;    /* Royal Blue */
    --secondary: #FF6D00;  /* Sunset Orange */
    --success: #06D6A0;    /* Emerald Green */
    --error: #EF233C;      /* Cherry Red */
    --text: #4A4A4A;       /* Charcoal Gray */
    --accent: #8338EC;     /* Soft Purple */
    --background: #F8FAFF !important; /* Light Blue-ish White */
    --white: #FFFFFF;
    --card-bg: #FFFFFF !important;
    --shadow: 0 4px 12px rgba(58, 134, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Ensure padding and border are included in the element's total width and height */
    font-family: 'Space Grotesk', sans-serif;
}

body {
    background-color: var(--background) !important;
    color: var(--text) !important;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* Auth Styles */
.auth-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.auth-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--white);
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.google-btn:hover {
    background: #f5f5f5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.google-btn img {
    width: 24px;
    height: 24px;
}

/* App Styles */
.app-container {
    min-height: 100vh;
    background-color: var(--background);
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 2rem;
}

/* Navigation */
.top-nav {
    background: transparent;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: flex-end; /* Align items to the right */
    align-items: center;
    box-shadow: none;
}

.top-nav h1 {
    display: none; /* Hide the title */
}

.sign-in-btn {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.sign-in-btn:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.2);
}

/* Main Content */
.main-content {
    max-width: 600px;
    flex: 0 1 600px;  /* Don't grow, can shrink, base width 600px */
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.main-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--primary);
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(58, 134, 255, 0.1);
}

/* Card Styles */
.bill-input-section, .people-section, .owing-screen {
    background: var(--card-bg) !important;
    padding: 1.8rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    color: var(--text) !important;
}

/* Input Styles */
input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 1.1rem;
    color: var(--text);
    transition: all 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(131, 56, 236, 0.1);
}

.amount-input input {
    font-family: 'Space Grotesk', monospace;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -1px;
    text-align: center;
    color: var(--primary);
    padding: 1.2rem;
    border-color: rgba(58, 134, 255, 0.2);
}

/* Specific styles for the "Amount paid" input */
#paidAmount {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    font-size: 1rem;
    color: var(--text);
    transition: all 0.2s;
    box-sizing: border-box;
}

#paidAmount:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(131, 56, 236, 0.1);
}

/* People List */
.person-item {
    background: var(--card-bg) !important;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
    border: 1px solid rgba(131, 56, 236, 0.15);
    color: var(--text) !important;
    font-size: 0.9rem;
}

.person-item > span {
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.paid-amount {
    color: var(--success);
    font-weight: 600;
    background: rgba(6, 214, 160, 0.1);
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* Payment Breakdown */
.owing-header {
    margin-bottom: 2rem;
}

.summary-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--card-bg) !important;
    color: var(--text) !important;
}

.summary-item i {
    font-size: 1.5rem;
    color: var(--primary);
    background: rgba(58, 134, 255, 0.1);
    padding: 0.8rem;
    border-radius: 50%;
}

.summary-details {
    display: flex;
    flex-direction: column;
}

.summary-details .label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.summary-details .value {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text);
}

.section-title {
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 1.5rem;
}

.debtor-group {
    background: var(--card-bg) !important;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    color: var(--text) !important;
}

.debtor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.debtor-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
}

.total-debt {
    font-size: 0.9rem;
    color: var(--text-light);
}

.owing-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    margin: 0.5rem 0;
    background: rgba(58, 134, 255, 0.05);
    border-radius: 8px;
    background: var(--card-bg) !important;
    color: var(--text) !important;
}

.owing-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.owing-info i {
    color: var(--secondary);
}

.recipient {
    font-weight: 500;
}

.payment-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.payment-status .amount {
    font-weight: 600;
    color: var(--primary);
}

.payment-status i {
    color: var(--secondary);
}

/* Buttons */
.primary-btn {
    background: var(--primary);
    color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.3px;
    box-shadow: 0 4px 12px rgba(58, 134, 255, 0.2);
}

.primary-btn:hover {
    background: #2b75ee;
    transform: translateY(-2px);
}

.secondary-btn {
    background: var(--secondary);
    color: var(--white);
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.secondary-btn:hover {
    background: #e66200;
    transform: translateY(-2px);
}

/* People Section */
.add-people {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
}

#personInput {
    flex: 1;
}

/* Update the add person button styles */
#addPersonBtn {
    background: var(--accent);
    color: var(--white);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

#addPersonBtn:hover {
    background: #7229db;
    transform: scale(1.05);
}

/* Update payment input container styles */
.payment-input {
    position: absolute;
    left: 0;
    right: 60px; /* Space for the plus button */
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: var(--white);
    z-index: 1;
}

#personInput, .payment-input {
    flex: 1;
}

.confirm-btn {
    background: var(--success);
    color: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.confirm-btn:hover {
    background: #05c090;
    transform: scale(1.05);
}

.edit-amount {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 0.2rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.edit-amount:hover {
    opacity: 1;
}

.people-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.remove-btn {
    background: none;
    border: none;
    color: var(--error);
    cursor: pointer;
    padding: 0.2rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.remove-btn:hover {
    opacity: 1;
}

/* Split Options */
.split-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.split-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    background: var(--white);
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.split-btn.active {
    background: var(--primary);
    color: var(--white);
    transform: scale(1.02);
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;  /* Calculate button takes more space */
    gap: 1rem;
    margin-top: 2rem;
}

/* Suggestions Dropdown */
.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-top: 0.5rem;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 0.8rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.suggestion-item:hover {
    background-color: #F1F3FF;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Base layout improvements */
    .app-container {
        padding: 0.8rem;
    }

    .main-content {
        padding: 0;
        margin: 0.8rem auto;
    }

    /* Header improvements */
    .main-content h1 {
        font-size: 1.8rem;
        margin-bottom: 1.2rem;
        text-shadow: none;
        color: var(--text);
    }

    /* Input section improvements */
    .add-people {
        gap: 0.8rem;
        margin-bottom: 1.2rem;
    }

    input {
        font-size: 16px !important; /* Prevent zoom on iOS */
        padding: 0.8rem;
        border-radius: 10px;
    }

    #addPersonBtn {
        width: 44px;
        height: 44px;
        border-radius: 8px;
    }

    /* Card improvements */
    .bill-input-section, 
    .people-section, 
    .owing-screen {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 12px;
        background: var(--white);
    }

    /* Person item improvements */
    .person-item {
        flex-direction: row;
        align-items: center;
    }

    .person-item > span {
        font-size: 1rem;
        font-weight: 500;
    }

    .paid-amount {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
        border-radius: 6px;
    }

    /* Summary card improvements */
    .summary-card {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .summary-item {
        background: var(--background);
        padding: 0.8rem;
        border-radius: 8px;
    }

    .summary-item i {
        font-size: 1.2rem;
        padding: 0.6rem;
    }

    .summary-details .label {
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
    }

    .summary-details .value {
        font-size: 1.3rem;
    }

    /* Settlement details improvements */
    .debtor-group {
        padding: 1rem;
        margin-bottom: 0.8rem;
    }

    .debtor-header {
        font-size: 1.1rem;
        padding-bottom: 0.8rem;
        margin-bottom: 0.8rem;
    }

    .owing-item {
        padding: 0.8rem;
        margin: 0.5rem 0;
        background: var(--background);
        border-radius: 8px;
    }

    .recipient {
        font-size: 0.95rem;
    }

    .payment-status .amount {
        font-size: 0.95rem;
    }

    /* Button improvements */
    .action-buttons {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .primary-btn,
    .secondary-btn {
        font-size: 1rem;
        padding: 0.8rem;
        border-radius: 8px;
        height: 44px;
    }

    /* Icon size adjustments */
    .edit-amount i, 
    .remove-btn i,
    .primary-btn i, 
    .secondary-btn i {
        font-size: 1rem;
    }

    /* Mobile-specific adjustments */
    #paidAmount {
        font-size: 14px !important;
        padding: 0.5rem;
        border-radius: 4px;
    }
}

/* Additional improvements for very small screens */
@media (max-width: 380px) {
    .app-container {
        padding: 0.6rem;
    }

    .main-content h1 {
        font-size: 1.6rem;
    }

    .person-item {
        flex-direction: column;
        align-items: stretch;
    }

    .amount-section {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(58, 134, 255, 0.1);
        justify-content: space-between;
    }

    .summary-details .value {
        font-size: 1.2rem;
    }

    .owing-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .payment-status {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Add these styles to your existing CSS */

.share-input {
    width: 60px;
    padding: 0.3rem;
    border: 1px solid #E0E7FF;
    border-radius: 8px;
    text-align: center;
    margin: 0 0.5rem;
}

.owing-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #F1F3FF;
}

.paid-detail {
    color: var(--text-light);
    font-size: 0.9rem;
}

.transfers-section {
    margin-top: 1rem;
    border-top: 2px solid #F1F3FF;
    padding-top: 1rem;
}

.transfers-section .owing-item {
    background: #F8F9FE;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

.transfers-section .payment-status {
    color: var(--primary);
}

.overpaid {
    color: var(--success);
    font-weight: 600;
}

.remaining {
    color: var(--error);
    font-weight: 600;
}

.debtor-group {
    background: var(--card-bg) !important;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 109, 0, 0.15);
    color: var(--text) !important;
}

.debtor-header {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid rgba(255, 109, 0, 0.15);
    letter-spacing: -0.5px;
}

.debtor-group .owing-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #E5E7EB;
}

.debtor-group .owing-item:last-child {
    border-bottom: none;
}

/* Add animation for status icons */
.payment-status i {
    transition: transform 0.3s ease;
}

.payment-status:hover i {
    transform: scale(1.2);
}

/* Add subtle hover effects */
.owing-item:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(131, 56, 236, 0.1);
}

.person-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(58, 134, 255, 0.1);
}

/* Update button styles */
#shareBtn {
    background: var(--accent);
}

#shareBtn:hover {
    background: #7229db;
    transform: translateY(-2px);
}

/* Base ad container styles */
.ad-container {
    position: sticky;
    top: 2rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Desktop ads */
@media (min-width: 1200px) {
    .desktop-only {
        display: flex;
        width: 160px;          /* Skyscraper */
        min-height: 600px;
    }
    .mobile-only {
        display: none;
    }
    .ad-container.left {
        order: -1;
    }
    .ad-container.right {
        order: 1;
    }
}

/* Mobile ad */
@media (max-width: 1199px) {
    .desktop-only {
        display: none;
    }
    .mobile-only {
        width: 100%;
        max-width: 320px;     /* Mobile banner width */
        min-height: 50px;
        margin: 1rem auto;
    }
}

/* Hide ads on mobile devices */
@media (max-width: 1199px) {
    .desktop-only-ad {
        display: none;
    }
}

/* Ensure ads are visible on desktop */
@media (min-width: 1200px) {
    .desktop-only-ad {
        display: block;
    }
} 