body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f0f2f5;
    color: #1c1e21;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Login Screen --- */
#login-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 350px;
    width: 90%;
    padding: 20px 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-align: center;
    z-index: 1000;
}

#login-container h1 {
    margin-bottom: 10px;
}

#login-container p {
    margin-bottom: 20px;
    color: #606770;
}

.register-link {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dddfe2;
}

.register-link p {
    margin: 0;
    color: #606770;
    font-size: 14px;
}

.register-link a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}

.register-link a:hover {
    text-decoration: underline;
}

/* --- Main Content --- */
#main-content {
    max-width: 800px;
    margin: 0 auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.header h1 {
    margin: 0;
    line-height: 44px;
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    position: relative;
}

h1, h2 {
    color: #000;
}

/* General Input and Button Styles */
input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #dddfe2;
    border-radius: 6px;
    box-sizing: border-box; /* Important */
}

button {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    background-color: #007bff;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #0056b3;
}

#view-gallery-btn {
    display: inline-block;  /* 버튼이 글자 크기에 맞춰 자동으로 늘어나도록 */
    width: auto;             /* 고정 크기 없이 내용(글자)에 따라 자동 너비 */
    padding: 12px 20px;
    font-size: 14px;
    margin-right: 4px;
    height: 44px;
    white-space: nowrap;     /* 줄바꿈 방지 (글자가 세로로 나열되지 않도록) */
}

#purchase-btn {
    display: inline-block;  /* 버튼이 글자 크기에 맞춰 자동으로 늘어나도록 */
    width: auto;             /* 고정 크기 없이 내용(글자)에 따라 자동 너비 */
    padding: 12px 20px;
    font-size: 14px;
    margin-right: 4px;
    height: 44px;
    white-space: nowrap;     /* 줄바꿈 방지 (글자가 세로로 나열되지 않도록) */
}

#menu-btn {
    width: auto;
    padding: 12px 20px;
    font-size: 14px;
    margin: 0;
    height: 44px;
}

#purchase-btn {
    background-color: #28a745;
}

#purchase-btn:hover {
    background-color: #218838;
}

#menu-btn {
    background-color: #6c757d;
}

#menu-btn:hover {
    background-color: #5a6268;
}

.menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 48px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    z-index: 1000;
}

.menu-item {
    width: 100%;
    text-align: left;
    padding: 10px 15px;
    border: none;
    background: white;
    cursor: pointer;
    color: #333;
    font-size: 14px;
    font-weight: normal;
}

.menu-item:hover {
    background-color: #f0f2f5;
}

.menu-item-top {
    border-radius: 4px 4px 0 0;
}

.menu-item-bottom {
    border-radius: 0 0 4px 4px;
    border-top: 1px solid #eee;
}

.purchase-item {
    background-color: #007bff;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}
/* font-size: 14px; */

.purchase-item:hover {
    background-color: #0056b3;
}

/* Card layout for sections */
.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    padding: 20px;
}

.input-group {
    margin-bottom: 15px;
}
.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #606770;
}

#send-photo-btn {
    margin-top: 15px;
    background-color: #28a745; /* Green color for the main action */
}

#send-photo-btn:hover {
    background-color: #218838;
}

#view-original-btn,
#view-generated-btn {
    margin-top: 15px;
}

/* Photo and Video Display */
#uploaded-image,
#server-img,
#generated-image,
#video-preview {
    display: block;
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    border-radius: 8px;
    margin: 15px auto;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    object-fit: contain;
}

/* Ensure server-img has same dimensions when using background-image */
#server-img {
    min-height: 400px;
    height: 400px;
    text-indent: -9999px;
    overflow: hidden;
    font-size: 0;
    color: transparent;
}

#photo-display-section {
    text-align: center;
}

/* Canvas for photo capture */
#canvas {
    max-width: 100%;
    margin: 0 auto;
}

/* Results Display */
#results-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 10px;
    justify-content: center;
}

.result-item {
    text-align: center;
    flex-basis: 100px; /* Base width for each item */
}

.result-item .color-box {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.result-item p {
    margin: 0;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* Responsive styles */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    #login-container {
        max-width: 100%;
        margin-bottom: 20px;
    }
    
    #main-content {
        max-width: 100%;
    }
    
    .result-item {
        flex-basis: 80px;
    }
    
    .result-item .color-box {
        width: 80px;
        height: 80px;
    }
}

#loader {
    font-size: 25px;
    text-align: center;
}

.error-message {
    padding: 0.75rem;
    margin-bottom: 1rem;
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 0.25rem;
}

.login-status {
    text-align: center;
    margin-top: 1rem;
    color: #666;
}

/* Scrollbar styling for stored images container */
#stored-images-container::-webkit-scrollbar {
    width: 10px;
}

#stored-images-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

#stored-images-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

#stored-images-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}
