/* Global Button Styles */
button {
    padding: 0 20px;
    height: 36px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 5px rgba(103, 58, 183, 0.3);
}

button:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 8px rgba(103, 58, 183, 0.4);
    transform: translateY(-1px);
}

/* Destructive Action Button */
#delete-profile-btn {
    background-color: #ef5350;
    box-shadow: 0 2px 5px rgba(239, 83, 80, 0.3);
}

#delete-profile-btn:hover {
    background-color: #d32f2f;
    box-shadow: 0 4px 8px rgba(239, 83, 80, 0.4);
}

/* View Toggle */
.view-toggle {
    display: flex;
    justify-content: center;
    gap: 0;
    margin: 20px auto 0;
    background: #e0e0e0;
    border-radius: 8px;
    padding: 4px;
    width: fit-content;
}

.toggle-btn {
    background: transparent;
    color: #666;
    box-shadow: none;
    border-radius: 6px;
    padding: 8px 24px;
    height: 36px;
    font-size: 14px;
    margin: 0;
}

.toggle-btn:hover {
    background: rgba(255,255,255,0.5);
    color: #333;
    transform: none;
    box-shadow: none;
}

.toggle-btn.active {
    background: #fff;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-weight: 700;
}

/* Floating Action Button */
.floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    font-size: 24px;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.3s ease;
    padding: 0; /* Reset padding */
}

.floating-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

/* Controls Section */
.controls {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    padding: 30px;
    background: #fff;
}

/* Input Groups */
.input-group {
    display: flex;
    flex-direction: column;
    grid-column: span 6;
}

.input-group.full-width {
    grid-column: 1 / -1;
}

.input-group label {
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

input, select {
    height: 36px;
    padding: 0 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #333;
    transition: all 0.2s ease;
}

input:focus, select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.1);
    outline: none;
}

/* Specific Layout Overrides */
.input-group:nth-child(1) { grid-column: span 8; } /* DOB */
.input-group:nth-child(2) { grid-column: span 4; } /* TOB */
.input-group:nth-child(3) { grid-column: span 6; } /* Location */
.input-group:nth-child(4) { grid-column: span 3; } /* Lat */
.input-group:nth-child(5) { grid-column: span 3; } /* Lon */

.input-group:nth-child(6) { /* Outer Planets */
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
    margin-top: 10px;
}

.input-group:nth-child(7) { /* Update Button */
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.input-group:nth-child(8) { /* Profile Section */
    grid-column: 1 / -1;
    background: #f8f9fa;
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
}

.input-group:nth-child(8) .search-box {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#update-btn {
    width: 100%;
    max-width: 300px;
    height: 42px;
    font-size: 15px;
    letter-spacing: 1px;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(63, 81, 181, 0.3);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

#update-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(63, 81, 181, 0.4);
}

/* Search Box */
.search-box {
    display: flex;
    gap: 0;
}

.search-box input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.search-box button {
    height: 36px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding: 0 25px;
}

.date-row {
    display: flex;
    gap: 10px;
}

.date-row select, .date-row input {
    height: 45px;
}

/* Header Action Button (Bookmark) */
.header-action-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 8px 16px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none;
    height: auto;
    backdrop-filter: blur(4px);
}

.header-action-btn:hover {
    background: white;
    color: #512da8;
    border-color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.header-action-btn svg {
    width: 16px;
    height: 16px;
}

/* Toast Notification */
.toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 16px;
    position: fixed;
    z-index: 1000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 50px;
}

/* Responsive */
@media (max-width: 900px) {
    .input-group:nth-child(2),
    .input-group:nth-child(3),
    .input-group:nth-child(4) {
        grid-column: 1 / -1;
    }
    
    .input-group:nth-child(5),
    .input-group:nth-child(6) {
        grid-column: span 6;
    }
}

@media (max-width: 600px) {
    .header-action-btn {
        display: none;
    }

    .controls {
        padding: 15px;
        gap: 15px;
    }

    .input-group, 
    .input-group:nth-child(n) {
        grid-column: 1 / -1 !important;
    }

    .date-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .date-row select, .date-row input {
        width: 100%;
        flex: none !important;
    }

    /* Fix for Search Box and Profile Buttons on Mobile */
    .search-box {
        flex-direction: column;
        gap: 10px;
    }

    .search-box input,
    .search-box select,
    .search-box button {
        width: 100%;
        border-radius: 6px !important;
        margin: 0;
    }

    .search-box input {
        border-right: 1px solid #e0e0e0;
    }
}
