:root {
    --primary-color: #4a8fe7;
    --accent-color: #6ba2ff;
    --accent-color2: #b2cbf7;
    --bg-color: #f5f9ff;
    --shadow-color: rgba(107, 162, 255, 0.3);
}

body {
    overflow: hidden;
}

@media (max-width: 768px) {
    body {
        overflow: auto;
    }
}

.webapp-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid rgba(214, 230, 255, 0.7);
    text-decoration: none;
}

.webapp-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(74, 143, 231, 0.2);
}

.webapp-thumbnail {
    width: 100%;
    object-fit: cover;
    border-bottom: 3px solid var(--accent-color);
}

.webapp-info {
    padding: 20px;
}

.webapp-name {
    color: var(--primary-color);
    font-family: 'Fredoka One', cursive;
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.webapp-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

#loading, #error {
    text-align: center;
    margin: 20px 0;
}

#error {
    color: #ff4d4d;
    display: none;
}

main {
    display: flex;
    height: calc(100vh - 80px);
    padding: 1rem;
}

#side {
    height: 95%;
    width: 400px;
    min-width: 400px;
    padding: 1.5rem;
    background: rgba(250, 250, 252, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(182, 203, 255, 0.3);
    backdrop-filter: blur(8px);
    border: 2px solid rgba(230, 230, 240, 0.8);
    margin-right: 1rem;
    overflow-y: auto;
    animation: slideUpFadeIn 0.6s ease-out both;
}

#side h1 {
    font-family: 'Fredoka One', cursive;
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 0 #d6e6ff;
}

label {
    display: block;
    margin: 0.8rem 0;
    color: #555;
    font-weight: 500;
}

input[type="file"],
input[type="color"] {
    margin-top: 0.5rem;
    width: 100%;
    padding: 0.5rem;
    border-radius: 8px;
    border: 2px solid #d6e6ff;
    background: white;
    transition: all 0.3s ease;
}

input[type="file"]:hover,
input[type="color"]:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(107, 162, 255, 0.2);
}

button {
    margin-top: 0.5rem;
    width: 100%;
    padding: 0.7rem;
    border-radius: 8px;
    border: none;
    background: var(--accent-color);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(107, 162, 255, 0.2);
}

button:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(107, 162, 255, 0.3);
}
		
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #cccccc !important;
    transform: none !important;
    box-shadow: none !important;
}

button:disabled:hover {
    background: #cccccc !important;
    transform: none !important;
    box-shadow: none !important;
}

.checkbox-container {
    display: flex;
    align-items: center;
    margin: 0.8rem 0;
}

.checkbox-container input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #d6e6ff;
    border-radius: 6px;
    margin-right: 10px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-container input[type="checkbox"]:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.checkbox-container input[type="checkbox"]:checked::after {
    content: "✓";
    position: absolute;
    color: white;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-container label {
    margin: 0;
    cursor: pointer;
}

#side > div:not(.checkbox-container) {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(214, 230, 255, 0.3);
    border-radius: 12px;
    border-left: 4px solid var(--accent-color);
}

#side > div p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: #555;
}

#side > div p:first-child {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.8rem;
}

#appDiv {
    border: 2px solid rgba(230, 230, 240, 0.8);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(182, 203, 255, 0.3);
    backdrop-filter: blur(8px);
    background: white;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 95%;
    animation: slideUpFadeIn 0.6s ease-out both;
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#zoomInfo {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    main {
        flex-direction: column;
        padding: 0.5rem;
        height: auto;
    }

    #side {
        width: auto;
        margin-right: 0;
        margin-bottom: 0.5rem;
        padding: 1rem;
    }

    #appDiv {
        height: 60vh;
    }

    .nav-links {
        gap: 0.5rem;
    }

    .nav-links a {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }
}

#animation-controls {
    display: flex;
    gap: 1rem;
}

.animation-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.anim-btn {
    background: var(--accent-color);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.anim-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.anim-btn:hover:not(:disabled) {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.animation-dropdown {
    flex: 1;
    padding: 0.5rem;
    border-radius: 8px;
    border: 2px solid #d6e6ff;
    background: white;
    color: #333;
}

.anim-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.anim-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
}

.frame-indicator {
    font-size: 0.9rem;
    color: #666;
    min-width: 100px;
    text-align: right;
}

#preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#animation-panel {
    background: rgba(250, 250, 252, 0.95);
    border-radius: 20px;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(182, 203, 255, 0.3);
    border: 2px solid rgba(230, 230, 240, 0.8);
    display: none;
}

#animation-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.animation-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    width: 100%;
}

.animation-row:first-child {
    margin-bottom: 0.5rem;
}

.animation-dropdown {
    width: 200px;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 2px solid #d6e6ff;
    background: white;
    color: #333;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234a8fe7'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.animation-dropdown:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(107, 162, 255, 0.2);
}

.frame-indicator {
    font-size: 0.9rem;
    color: #666;
    min-width: 120px;
    text-align: center;
    background: rgba(214, 230, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
}

.anim-slider {
    flex-grow: 1;
    height: 8px;
    border-radius: 4px;
    background: #e0e9ff;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: all 0.3s ease;
    min-width: 0;
}

.anim-slider:hover {
    background: #d0e0ff;
}

.anim-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.anim-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: var(--primary-color);
}

.anim-btn {
    background: var(--accent-color);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(107, 162, 255, 0.2);
}

.anim-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}

.anim-btn:hover:not(:disabled) {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(107, 162, 255, 0.3);
}

.section-title {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 768px) {
    #animation-panel {
        margin: 0.5rem 0;
        padding: 0.75rem;
    }
    
    .animation-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .animation-dropdown {
        width: 100%;
    }
    
    .anim-btn {
        width: 100%;
        justify-content: center;
    }
    
    .frame-indicator {
        width: 100%;
        text-align: center;
    }
}

#textureInfo p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
