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

:root {
    --primary-color: #10b981;
    --primary-dark: #059669;
    --secondary-color: #6366f1;
    --danger-color: #ef4444;
    --background: #f9fafb;
    --surface: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Screen Management */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Auth Screen */
#auth-screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo h1 {
    font-size: 3rem;
    margin-bottom: 8px;
}

.logo p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.auth-form {
    display: none;
    background: var(--surface);
    padding: 32px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    margin-bottom: 24px;
    text-align: center;
}

.auth-form input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.auth-toggle {
    text-align: center;
    margin-top: 16px;
    color: var(--text-secondary);
}

.auth-toggle a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.error-message {
    margin-top: 16px;
    padding: 12px;
    background-color: #fee;
    color: var(--danger-color);
    border-radius: 8px;
    text-align: center;
    display: none;
}

.error-message.show {
    display: block;
}

/* App Header */
.app-header {
    background: var(--surface);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 1.5rem;
}

/* Container */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.highlight-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

.total-amount {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.subtitle {
    text-align: center;
    opacity: 0.8;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Buttons */
button {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    width: 100%;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-large {
    padding: 16px 24px;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.btn-text {
    background: none;
    color: var(--primary-color);
    padding: 8px 12px;
    font-weight: 600;
}

.btn-text:hover {
    background: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
}

.btn-close {
    background: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    color: var(--text-primary);
}

/* Sections */
.section {
    margin-bottom: 32px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section h2 {
    font-size: 1.3rem;
}

/* Goals List */
.goals-list {
    display: grid;
    gap: 16px;
}

.goal-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.goal-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.goal-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.goal-target {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.goal-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Pledges List */
.pledges-list {
    display: grid;
    gap: 12px;
}

.pledge-item {
    background: var(--surface);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pledge-info {
    flex: 1;
}

.pledge-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.pledge-goal {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.pledge-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
    font-style: italic;
}

.pledge-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.pledge-delete {
    background: none;
    color: var(--text-secondary);
    padding: 8px;
    font-size: 1.2rem;
}

.pledge-delete:hover {
    color: var(--danger-color);
}

/* Settings Summary */
.settings-summary {
    background: var(--surface);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.settings-summary p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.settings-summary strong {
    color: var(--text-primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.3rem;
}

.modal-body {
    padding: 24px;
}

.modal-body label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    margin-top: 16px;
}

.modal-body label:first-child {
    margin-top: 0;
}

.modal-body input,
.modal-body select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

.modal-body input:focus,
.modal-body select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-group input {
    padding-left: 36px;
}

.transfer-message {
    font-size: 1.1rem;
    margin-bottom: 16px;
    text-align: center;
}

.transfer-message strong {
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        padding: 16px;
    }

    .card {
        padding: 20px;
    }

    .total-amount {
        font-size: 2.5rem;
    }

    .modal-content {
        max-height: 95vh;
    }
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Success Animation */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.success-animation {
    animation: successPulse 0.3s ease;
}
