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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.page {
    display: none !important;
}

.page.active {
    display: block !important;
}

/* Landing Page */
.landing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    color: white;
}

.logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: white;
    color: #667eea;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.btn-secondary {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

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

.btn-danger {
    background: #ff4757;
    color: white;
}

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

.btn-success {
    background: #2ed573;
    color: white;
}

.btn-success:hover {
    background: #26d465;
}

/* Board Page */
.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.back-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

.board-title-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#board-title {
    color: #333;
    font-size: 1.8rem;
    margin: 0;
}

.board-title-input {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
    border: 2px solid #667eea;
    border-radius: 6px;
    padding: 4px 8px;
    background: white;
    width: 300px;
    font-family: inherit;
}

.edit-title-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
    opacity: 0.6;
}

.edit-title-btn:hover {
    background: rgba(0,0,0,0.05);
    opacity: 1;
}

.board-controls {
    margin-bottom: 2rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Gift Card */
.gift-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    border-left: 5px solid;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.gift-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.gift-card.used {
    opacity: 0.6;
    position: relative;
}

.gift-card.used::after {
    content: 'USED';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    font-size: 3rem;
    font-weight: bold;
    color: rgba(0,0,0,0.2);
    pointer-events: none;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.card-amount {
    font-size: 1.1rem;
    color: #666;
    margin: 0.5rem 0;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.card-actions .btn {
    flex: 1;
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Modal */
.modal {
    display: none !important;
    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;
}

.modal.active {
    display: flex !important;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.color-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.color-option {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #333;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #333;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Auth Section */
#auth-section {
    margin-bottom: 2rem;
}

#user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255,255,255,0.2);
    padding: 1rem;
    border-radius: 8px;
    color: white;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
}

#user-name {
    flex: 1;
    font-weight: 500;
}

#login-section {
    text-align: center;
}

#login-section .btn {
    display: inline-flex;
    align-items: center;
}

.boards-list {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.board-card {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 1.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.board-card:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.board-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.board-card p {
    margin: 0;
    opacity: 0.8;
    font-size: 0.9rem;
}

.shared-with-list {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.shared-email {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.shared-email span {
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .board-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .logo {
        font-size: 3rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    #user-info {
        flex-direction: column;
        text-align: center;
    }
}

