:root {
    /* FizzMonkey Brand Colors */
    --color-lime-green: #A6ED39;
    --color-turquoise-blue: #1EC5E5;
    --color-accent-orange: #FF8C42;
    --color-charcoal: #2C2C2C;
    --color-soft-white: #F9F9F9;
    --color-light-grey: #E6E6E6;

    /* Fonts */
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Open Sans', sans-serif;
}

body {
    font-family: var(--font-secondary);
    background-color: #f7f9fc;
    color: var(--color-charcoal);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: "";
    background-image: url('/images/auth-pattern.png');
    background-size: 400px;
    background-repeat: repeat;
    opacity: 0.07;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-primary);
    margin-bottom: 0.5em;
    font-weight: 700;
}

button,
.btn {
    font-family: var(--font-primary);
    font-weight: 700;
    /* Bolder */
    border: none;
    border-radius: 9999px;
    padding: 12px 28px;
    /* Slightly larger touch target */
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* Smoother transition */
    position: relative;
    overflow: hidden;
    text-decoration: none;
    /* No underline for links */
    display: inline-block;
    /* Ensure links behave like blocks */
    text-align: center;
}

button:hover,
.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15), 0 6px 6px rgba(0, 0, 0, 0.1);
}

button:active,
.btn:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #B4F550 0%, #A6ED39 100%);
    /* Slight gradient on lime */
    color: var(--color-charcoal);
    box-shadow: 0 4px 15px rgba(166, 237, 57, 0.4);
    /* Colored shadow */
}

.btn-primary:hover {
    background: linear-gradient(135deg, #C1F765 0%, #B4F550 100%);
    box-shadow: 0 8px 25px rgba(166, 237, 57, 0.6);
}

.btn-secondary {
    background: linear-gradient(135deg, #38D7F7 0%, #1EC5E5 100%);
    /* Slight gradient on turquoise */
    color: white;
    box-shadow: 0 4px 15px rgba(30, 197, 229, 0.4);
    /* Colored shadow */
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5EE0FA 0%, #38D7F7 100%);
    box-shadow: 0 8px 25px rgba(30, 197, 229, 0.6);
}

.btn-accent {
    background-color: var(--color-accent-orange);
    color: white;
    box-shadow: 0 4px 10px rgba(255, 140, 66, 0.3);
}

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

/* Header */
header {
    width: 100%;
    background-color: white;
    border-bottom: 2px solid var(--color-light-grey);
    margin-bottom: 30px;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    height: 70px;
    width: auto;
    padding-bottom: 16px;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-charcoal);
    letter-spacing: -0.5px;
}

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

/* Sections */
.section-item {
    border-bottom: 1px solid var(--color-light-grey);
    padding: 15px 0;
}

.section-item:last-child {
    border-bottom: none;
}

.item-meta {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
}

/* Forms */
input,
select,
textarea {
    width: 85%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--color-light-grey);
    border-radius: 8px;
    font-family: var(--font-secondary);
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    /* Ensure it fits on screen */
    overflow-y: auto;
    /* Scroll if too tall */
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: color 0.2s, transform 0.1s;
}

.icon-btn:hover {
    color: #000;
    transform: scale(1.1);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

/* Utility classes */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.gap-2 {
    gap: 0.5rem;
}

.justify-between {
    justify-content: space-between;
}

.text-small {
    font-size: 0.8rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    font-size: 0.7rem;
}

.badge-gray {
    background-color: #95a5a6;
}

.badge-red {
    background-color: #e74c3c;
}

.badge-blue {
    background-color: #3498db;
}

.badge-green {
    background-color: #2ecc71;
}

/* Image Viewer & Annotations */
.image-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: transform 0.2s;
}

.image-thumbnail:hover {
    transform: scale(1.05);
}

.image-viewer-content {
    width: 95%;
    max-width: 1000px;
    /* Larger max width for images */
    height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

#image-display-container {
    flex-grow: 1;
    position: relative;
    overflow: visible;
    /* Force fit */
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    min-height: 0;
    /* Important for flex child scrolling/sizing */
}

/* Wrapper shrinks to fit the image's intrinsic size (constrained by max-width/height) */
#image-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
}

#annotations-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Allow clicks to pass through to image for new notes */
}

#target-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* Just in case */
    display: block;
    width: auto;
    height: auto;
    cursor: crosshair;
}

.annotation-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: rgba(231, 76, 60, 0.8);
    /* Red semi-transparent */
    border: 2px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    /* Center on coordinate */
    cursor: pointer;
    pointer-events: auto;
    /* Required as parent has none */
    z-index: 10;
    transition: transform 0.2s;
}

.annotation-dot:hover {
    transform: translate(-50%, -50%) scale(1.2);
    background-color: rgba(231, 76, 60, 1);
    z-index: 11;
}

.annotation-dotTheme-green {
    background-color: #2ecc71 !important;
    border-color: #fff;
    z-index: 12;
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.annotation-label {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.annotation-dot:hover .annotation-label {
    opacity: 1;
}

.hidden {
    display: none !important;
}