:root {
    --sidebar-width: 340px;
    --header-height: 60px;
    --primary-color: #1877f2;
    --secondary-color: #42b72a;
    --danger-color: #fa3e3e;
    --border-radius: 12px;
    --light-gray: #f0f2f5;
    --medium-gray: #e4e6eb;
    --text-color: #606770;
    --transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--light-gray);
    margin: 0;
    overflow-x: hidden;
}


#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background-color: var(--light-gray);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.7s ease, visibility 0.7s ease;
}

#preloader.preloader-hide {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
    color: #333;
}

.preloader-icon {
    font-size: 60px;
    color: var(--primary-color);
    animation: pulse 1.5s infinite ease-in-out;
}

#preloader-text {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 1rem;
    margin-top: 15px;
    color: var(--text-color);
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}


body.history-open,
body.menu-open {
    overflow: hidden;
}

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}

.left-nav,
.right-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.icon-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    color: #606770;
    transition: background-color 0.2s ease;
}

.icon-button:hover {
    background-color: var(--medium-gray);
}

#home-button {
    text-decoration: none;
}

#auth-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#google-signin-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #fff;
    color: #333;
    border: 1px solid #ccc;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
}

#google-signin-btn img {
    width: 18px;
    height: 18px;
}

#user-profile {
    align-items: center;
    gap: 10px;
    display: flex;
}

#user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

#user-coins-container {
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid #ddd;
    font-weight: bold;
    color: #555;
    font-size: 14px;
}

#user-coins-container .material-icons {
    color: gold;
}

.main-content {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: var(--header-height) 20px 20px 20px;
}

.container {
    text-align: center;
    padding: 40px;
    border-radius: var(--border-radius);
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 480px;
}

#sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.45);
    z-index: 1010;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease;
}

body.history-open #sidebar-backdrop,
body.menu-open #sidebar-backdrop {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    background-color: #f8f9fa;
    height: 100vh;
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    max-width: 90%;
    z-index: 1020;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform var(--transition-speed) ease;
}

#sidebar-history {
    right: 0;
    z-index: 1020;
}

body.history-open #sidebar-history {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    padding: 10px 15px;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
    height: var(--header-height);
}

#sidebar-history h2,
#sidebar-menu h2 {
    margin: 0;
    color: #495057;
    font-size: 1.1em;
}

#sidebar-menu {
    right: 0;
    z-index: 1030;
}

body.menu-open #sidebar-menu {
    transform: translateX(0);
}

.menu-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-user img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.menu-user .user-info {
    display: flex;
    flex-direction: column;
}

.menu-user .user-name {
    font-weight: 700;
    color: #222;
}

.menu-user .user-id {
    font-size: 13px;
    color: #444;
    background: #fff;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #ddd;
    display: inline-block;
    margin-top: 6px;
}

#history-list {
    list-style: none;
    padding: 20px;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
}

#history-list li {
    background: #fff;
    margin-bottom: 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    transition: box-shadow 0.2s;
    word-wrap: break-word;
}

#history-list li:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#history-list a {
    text-decoration: none;
    color: var(--primary-color);
    padding: 15px;
    display: block;
    text-align: left;
}

#history-list .filename {
    font-weight: bold;
    font-size: 14px;
    display: block;
    margin-bottom: 5px;
}

#history-list .timestamp {
    font-size: 12px;
    color: var(--text-color);
    display: block;
}

h1 {
    color: #1c1e21;
    margin-bottom: 10px;
}

p {
    color: var(--text-color);
    font-size: 16px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
    width: 100%;
    text-align: left;
}

label {
    font-weight: 500;
    display: block;
    margin-bottom: 5px;
    color: #333;
}

input[type="file"],
input[type="text"],
input[type="password"],
select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ddd;
    padding: 12px;
    border-radius: 6px;
    font-size: 16px;
}

input[type="file"]:disabled {
    background-color: #f0f2f5;
    cursor: not-allowed;
}

select:disabled {
    background-color: #f0f2f5;
    cursor: not-allowed;
}

button.primary-button {
    cursor: pointer;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    margin-top: 10px;
    width: 100%;
    transition: background-color 0.2s;
}

button.primary-button:hover {
    background-color: #166fe5;
}

button.primary-button:disabled {
    background-color: #9dbef5;
    cursor: not-allowed;
}

.loader {
    border: 8px solid #f3f3f3;
    border-radius: 50%;
    border-top: 8px solid var(--primary-color);
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.button {
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    margin-top: 10px;
}

.button.success {
    background-color: var(--secondary-color);
}

.button.error {
    background-color: var(--danger-color);
}

#build-timer {
    font-size: 24px;
    color: #1c1e21;
    font-weight: bold;
    margin: 10px 0;
    font-family: monospace;
}

.hidden {
    display: none !important;
}

#failed-view {
    width: 100%;
}

#log-output {
    background-color: #282c34;
    color: #abb2bf;
    text-align: left;
    padding: 15px;
    border-radius: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 350px;
    overflow-y: auto;
    margin-top: 20px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 14px;
    border: 1px solid #3c4048;
}

#build-id-display,
#failed-build-id-display {
    background-color: #e9e9eb;
    color: #4b4f56;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: monospace;
    word-break: break-all;
    margin: 15px 0;
    font-size: 14px;
    border: 1px solid #ddd;
}

#free-upload-notice {
    background: #fff8e1;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ffecb3;
    font-size: 13px;
    color: #6b4f00;
    margin-bottom: 10px;
}

.duration-text {
    font-size: 14px;
    color: #606770;
    margin-top: -10px;
}

#more-button {
    width: 40px;
    height: 40px;
}

#more-button .material-icons {
    font-size: 22px;
}

#realtime-log-container {
    background-color: #282c34;
    color: #abb2bf;
    text-align: left;
    padding: 15px;
    border-radius: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 150px;
    height: 150px;
    overflow-y: auto;
    margin-top: 15px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 14px;
    border: 1px solid #3c4048;
    transition: opacity 0.3s;
}

.log-line {
    display: block;
    margin-bottom: 5px;
}

.log-line:last-child {
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}