/* Utility classes for dynamic styling */
.hidden {
    display: none;
}

.visible {
    display: block;
}

.transparent-bg {
    background-color: transparent;
}

.text-light {
    color: #c0c1c3;
}

.canvas-hidden {
    display: none;
}

.full-height {
    height: 100%;
}

/* Remove all !important flags - they're not needed with proper classes */
/* Cleaned-up version of your CSS removing all !important flags */

.camera-container, .bucket-image-container {
    height: 300px;
    margin-bottom: 15px;
}

#camera-feed, .captured-image, .bucket-image {
    width: 100%;
    height: 240px; /* EXACT same height for all images */
    object-fit: cover;
    border-radius: 10px;
    max-height: 250px;
    display: block;
}

.camera-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    height: 240px; /* Fixed consistent height */
    margin-bottom: 0; /* Remove bottom margin */
    display: block;
}

.camera-controls {
    text-align: center;
    margin: 15px 0;
}

#capture-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#capture-btn:hover {
    background-color: #2980b9;
}

.camera-message {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 10px;
    border-radius: 0 0 10px 10px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.user-caption {
    margin-bottom: 10px;
    text-align: center;
    font-style: italic;
    color: #c0c1c3;
    font-size: 1rem;
}

.user-caption.top-caption {
    margin-bottom: 0;
    border-radius: 5px 5px 0 0;
}

.user-caption.bottom-caption {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Update the bucket image styles */

/* Special style just for the bucket image */
.bucket-image {
    width: 100%;
    max-width: 400px;
    height: auto; /* Let height adjust based on aspect ratio */
    max-height: 300px; /* Maximum height */
    border-radius: 10px;
    display: block;
    object-fit: contain; /* Show the full image */
}

/* Keep camera feed and captured image as cover */
#camera-feed, .captured-image {
    width: 100%;
    height: 240px;
    object-fit: cover; /* Camera images still use cover */
    border-radius: 10px;
    display: block;
}

/* Adjust container sizes */
.bucket-image-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 20px; /* Reduced bottom margin */
    display: flex;
    flex-direction: column;
    height: auto; /* Let height adjust to content */
}

/* Profile photo preview */
.profile-photo-preview {
    margin-bottom: 15px;
    text-align: center;
}

.profile-photo-preview img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #3498db;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.profile-photo-preview p {
    margin-top: 10px;
    color: #2980b9;
    font-weight: bold;
}

.retake-button {
    background-color: #95a5a6;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 5px;
    transition: background-color 0.3s;
}

.retake-button:hover {
    background-color: #7f8c8d;
}

.bucket-visible {
    display: block;
}

.bucket-full-height {
    height: 100%;
}

/* Add similar classes for other inline styles */

/* Add this to ensure auth links are closer to the image */
.auth-links {
    margin-top: 15px;
}

/* Fix the auth link spacing */
.auth-link {
    margin: 0.4rem 0; /* Reduced from 0.72rem to 0.4rem */
}

/* Ensure the main container has no extra padding */
main .container {
    padding-bottom: 0; /* Remove any bottom padding */
}

/* Add these aggressive spacing fixes at the end of your file */

/* Force minimal spacing between camera and auth links */
.camera-container {
    height: 320px; /* Further reduced height */
    margin-bottom: 0; /* Force no bottom margin */
}

/* Target the specific spacing issue between camera and auth links */
.bucket-image-container + .auth-links,
.camera-container + .auth-links {
    margin-top: 0; /* Force no margin above auth links */
}

/* Reduce any padding on parent containers */
.container {
    padding-bottom: 0;
    padding-top: 0;
}

/* Override any margin on the auth-links container */
.auth-links {
    margin-top: 0;
    margin-bottom: 0;
}

/* Add a negative margin to pull links up if needed */
.auth-link:first-child {
    margin-top: -5px;
}

/* Ensure minimal spacing between auth links */
.auth-link {
    margin: 0.3rem 0; /* Even more reduced spacing */
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}

/* Add these rules to fix the camera display */

/* Make sure canvas is completely hidden */
#camera-canvas {
    display: none !important;
}

/* Ensure captured image takes full width and looks nice */
.captured-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

/* Prevent video overlap */
#camera-feed {
    width: 100%; 
    height: 240px;
    object-fit: cover;
    border-radius: 10px;
}

/* Make camera container block-level to prevent overlap */
.camera-container {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    position: relative;
    height: 240px;
}