@import url('https://fonts.googleapis.com/css2?family=Sniglet:wght@400;800&display=swap');
@import url("./fx.css");

* {
    box-sizing: border-box;
}

html, body {
    min-height: 100vh;
    width: 100%;
}

body {
	background-color: #8cc2da;
	font-family: "Sniglet", sans-serif;
    overflow: hidden;
    margin: 0;
}

.main {
    width: 100%;
    height: 100vh;
    .view {
        inset: 0;
        width: 100vw;
        height: 100vh;
        position: absolute;

        text-align: center;

        display: none;
        &.active {
            display: flex;
        }
        opacity: 0;
        transform: scale(1.2);
        &.fade-in {
            opacity: 1;
            transform: scale(1);
            &.fade-out {
                opacity: 0;
                transform: scale(.8);
            }
        }
        transition: opacity .5s ease, transform .5s ease;
    }
}

.center-inner {
    width: 600px;
    max-height: 100vh;
    overflow-y: auto;
    padding: 50px 0;
}

h1 {
    font-size: 55px;
    font-family: "Sniglet", sans-serif;
    font-weight: 400;
    color: #fff;
    text-shadow: 0px 5px 0px #4b7b90;
    margin-bottom: 0;
}

h2 {
    font-size: 32px;
    font-family: "Sniglet", sans-serif;
    font-weight: 400;
    color: #2d382b;
    margin-top: 0;
    margin-bottom: 20px;
}

.logo {
    max-width: 400px;
    width: 100%;
}

.center-outer {
    display: flex;
    justify-content: center;
    align-items: center;
}

.center-inner {
    display: inline-block;
}

.toon-btn {
	display: inline-block;
	padding: 12px 32px;
	padding-bottom: 16px;
	border-radius: 50px;
	font-size: 20px;
	text-decoration: none;
	color: white;
	cursor: pointer;

    font-family: "Sniglet", sans-serif;

	border: 2px solid #2d382b;

	font-weight: 400;
	text-shadow: 0px 2px 0px rgba(0, 0, 0, 0.15);

	transition: all 0.1s ease;
}

.btn-green {
	background-color: #76c47d;
	box-shadow: inset 0 -6px 0 0 #539e5a;

	&:active {
		background-color: #539e5a;
	}
}

.btn-orange {
	background-color: #f4ce6a;
	box-shadow: inset 0 -6px 0 0 #dcb048;

	&:active {
		background-color: #dcb048;
	}
}

.toon-btn:active {
	box-shadow: inset 0 -3px 0 0 rgba(0, 0, 0, 0.2);
}

.toon-input {
	width: 300px;
	padding: 13px 20px;
	border-radius: 50px;
	font-size: 24px;
	outline: none;

	background-color: #ffffff;
	color: #2d382b;
	font-family: "Sniglet", sans-serif;
	font-weight: 500;

	border: 3px solid #2d382b;

	box-shadow: inset 0 7px 0 0 #cce0eb;

	transition: all 0.2s ease;

    &.success {
        border-color: #76c47d !important;
    }
}

::placeholder {
	color: #aab8c0;
	font-weight: 500;
}

.toon-input:focus {
	border-color: #f4ce6a;

	box-shadow: inset 0 4px 0 0 #e9e0c9;
}

.pin-hint {
    text-align: center;
    font-size: 20px;
    margin-top: 0;
}
.pin-input {
    letter-spacing: 20px;
    text-align: center;
}

.pin-error {
    text-align: center;
    font-size: 18px;
    color: #ff4d4d;
    margin-top: 10px;
    margin-bottom: 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.pin-error.show {
    opacity: 1;
    transform: translateY(0);
}

.pin-input.error {
    border-color: #ff4d4d !important;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* --- SNOW EFFECT --- */
.snow-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.main {
    position: relative;
    z-index: 1;
}

/* --- FORM STYLES --- */
.preferences-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    /* Optional: Add a background card if needed, but transparent is fine too */
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.toon-label {
    font-size: 20px;
    color: #2d382b;
    margin-left: 10px;
}

/* Custom Select */
.select-wrapper {
    position: relative;
    width: 100%;
}

.toon-select {
    width: 100%;
    appearance: none; /* Remove default arrow */
    cursor: pointer;
    padding-right: 50px; /* Space for arrow */
    font-family: "Sniglet", sans-serif;
    font-size: 18px;
    padding: 12px 15px;
}

.select-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #2d382b;
    font-size: 16px;
}

/* Chip / Toggle Buttons */
.style-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.toon-chip {
    cursor: pointer;
    user-select: none;
}

.toon-chip input {
    display: none;
}

.chip-content {
    display: inline-block;
    padding: 8px 20px;
    padding-bottom: 10px;
    border-radius: 30px;
    background-color: #fff;
    border: 2px solid #2d382b;
    color: #2d382b;
    font-size: 18px;
    box-shadow: inset 0 -4px 0 0 #cce0eb;
    transition: all 0.1s ease;
}

/* Checked State */
.toon-chip input:checked + .chip-content {
    background-color: #76c47d; /* Green */
    box-shadow: inset 0 -4px 0 0 #5a9c5f;
    transform: translateY(2px);
}

/* Active/Press State */
.toon-chip:active .chip-content {
    box-shadow: inset 0 -2px 0 0 rgba(0,0,0,0.2);
    transform: translateY(2px);
}

/* Textarea */
.toon-textarea {
    width: 100%;
    height: 100px;
    resize: vertical;
    border-radius: 25px; /* Slightly less rounded for boxy feel */
    padding: 15px;
    font-family: "Sniglet", sans-serif;
    font-size: 20px;

    min-height: 100px;
    max-height: 500px;
}

/* Adjust button width */
.preferences-form button {
    margin-top: 10px;
    width: 100%;
}

/* --- ASSIGNMENT VIEW STYLES --- */
.assignment-details {
    background-color: rgba(255, 255, 255, 0.8);
    border: 3px solid #2d382b;
    border-radius: 30px;
    padding: 30px;
    margin: 20px auto;
    max-width: 500px;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h3 {
    font-size: 18px;
    color: #2d382b;
    margin: 0 0 8px 0;
    font-weight: 400;
}

.detail-section p {
    font-size: 24px;
    color: #4b7b90;
    margin: 0;
    font-weight: 400;
}

.assigned-name {
    font-size: 48px;
}

.change-prefs-btn {
    margin-top: 20px;
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 768px), (max-height: 870px) {
    h1 {
        font-size: 40px;
        text-shadow: 0px 3px 0px #4b7b90;
    }

    h2 {
        font-size: 24px;
    }

    .toon-btn {
        padding: 10px 24px;
        padding-bottom: 14px;
        font-size: 18px;
    }

    .toon-input {
        width: 100%;
        max-width: 280px;
        padding: 11px 16px;
        font-size: 20px;
    }

    .pin-hint {
        font-size: 18px;
        padding: 0 20px;
    }

    .pin-input {
        letter-spacing: 15px;
    }

    .preferences-form {
        max-width: 100%;
        padding: 10px;
    }

    .toon-label {
        font-size: 18px;
    }

    .toon-select {
        font-size: 16px;
    }

    .chip-content {
        font-size: 16px;
        padding: 7px 16px;
        padding-bottom: 9px;
    }

    .toon-textarea {
        font-size: 18px;
        padding: 12px;
    }

    .assignment-details {
        padding: 20px;
        margin: 15px auto;
    }

    .assigned-name {
        font-size: 36px;
    }

    .detail-section h3 {
        font-size: 16px;
    }

    .detail-section p {
        font-size: 20px;
    }

    .center-inner {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 32px;
        text-shadow: 0px 2px 0px #4b7b90;
    }

    h2 {
        font-size: 20px;
    }

    .toon-btn {
        padding: 8px 20px;
        padding-bottom: 12px;
        font-size: 16px;
    }

    .toon-input {
        max-width: 260px;
        padding: 10px 14px;
        font-size: 18px;
    }

    .pin-hint {
        font-size: 16px;
    }

    .pin-input {
        letter-spacing: 12px;
        font-size: 20px;
    }

    .toon-label {
        font-size: 16px;
    }

    .toon-select {
        font-size: 14px;
        padding: 10px 12px;
    }

    .chip-content {
        font-size: 14px;
        padding: 6px 14px;
        padding-bottom: 8px;
    }

    .toon-textarea {
        font-size: 16px;
        padding: 10px;
    }

    .assignment-details {
        padding: 15px;
        margin: 10px auto;
    }

    .assigned-name {
        font-size: 28px;
    }

    .detail-section {
        margin-bottom: 15px;
    }

    .detail-section h3 {
        font-size: 14px;
    }

    .detail-section p {
        font-size: 18px;
    }

    .view-assignment-btn,
    .change-prefs-btn {
        margin-top: 15px;
    }
}

/* --- TOAST NOTIFICATION --- */
.toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: 9999;
    
    background-color: #76c47d;
    border: 3px solid #2d382b;
    border-radius: 50px;
    padding: 15px 35px;
    padding-bottom: 19px;
    
    font-family: "Sniglet", sans-serif;
    font-size: 20px;
    color: white;
    text-shadow: 0px 2px 0px rgba(0, 0, 0, 0.15);
    box-shadow: inset 0 -6px 0 0 #539e5a, 0 10px 30px rgba(0, 0, 0, 0.3);
    
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.hide {
    opacity: 0;
    transform: translateX(-50%) translateY(-100px);
}

@media (max-width: 768px) {
    .toast {
        top: 20px;
        max-width: 90%;
        padding: 12px 28px;
        padding-bottom: 16px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .toast {
        top: 15px;
        max-width: 85%;
        padding: 10px 24px;
        padding-bottom: 14px;
        font-size: 16px;
    }
}