/**
 * Grade Converter Styles
 * 
 * @package GradeConverter
 * @version 2.0.2
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
	--gc-primary: #FBBA03;
	--gc-secondary: #31DD94;
	--gc-white: #FFFFFF;
	--gc-dark: #333333;
	--gc-gray: #f4f4f4;
	--gc-light-gray: #e0e0e0;
	--gc-error: #ef4444;
	--gc-success: #10b981;
	--gc-border-radius: 12px;
	--gc-border-radius-sm: 8px;
	--gc-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
	--gc-shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.12);
	--gc-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	--gc-transition-fast: all 0.15s ease;
}

/* ========================================
   Layout & Container
   ======================================== */
.gc-wrapper {
	max-width: 100%;
	margin: 40px auto;
	padding: 0 20px;
	box-sizing: border-box;
}

.gc-wrapper,
.gc-wrapper * {
	font-family: inherit !important;
	box-sizing: border-box;
}

.gc-container {
	background: var(--gc-white);
	border-radius: var(--gc-border-radius);
	box-shadow: var(--gc-shadow);
	padding: 40px;
	transition: var(--gc-transition);
	position: relative;
}

.gc-container:hover {
	box-shadow: var(--gc-shadow-hover);
}

/* ========================================
   Converter Box
   ======================================== */
.gc-converter-box {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* ========================================
   Input Groups
   ======================================== */
.gc-input-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.gc-input-group label {
	font-weight: 600;
	color: var(--gc-dark);
	font-size: 0.95rem;
	transition: var(--gc-transition-fast);
}

.gc-input-group:focus-within label {
	background: linear-gradient(to right, var(--gc-primary), var(--gc-secondary));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

/* ========================================
   Form Controls
   ======================================== */
.gc-select,
.gc-input {
	padding: 14px 16px;
	border: 2px solid var(--gc-light-gray);
	border-radius: var(--gc-border-radius-sm);
	font-size: 1rem;
	transition: var(--gc-transition);
	width: 100%;
	box-sizing: border-box;
	background: var(--gc-white);
	color: var(--gc-dark);
}

.gc-select {
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 20px;
	padding-right: 45px;
}

.gc-select:hover,
.gc-input:hover {
	border-color: #ccc;
}

.gc-select:focus,
.gc-input:focus {
	outline: none;
	border: 2px solid transparent;
	background-image: linear-gradient(white, white), linear-gradient(to right, var(--gc-primary), var(--gc-secondary));
	background-origin: border-box;
	background-clip: padding-box, border-box;
	box-shadow: 0 0 0 3px rgba(251, 186, 3, 0.1);
}

.gc-select:focus {
	background-image:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23FBBA03' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"),
		linear-gradient(white, white),
		linear-gradient(to right, var(--gc-primary), var(--gc-secondary));
	background-repeat: no-repeat, no-repeat, no-repeat;
	background-position: right 12px center, border-box, border-box;
	background-size: 20px, auto, auto;
}

.gc-input:invalid {
	border-color: var(--gc-error);
}

/* ========================================
   Swap Button
   ======================================== */
.gc-swap-container {
	display: flex;
	justify-content: center;
	margin: -10px 0;
	z-index: 2;
}

.gc-swap-btn {
	background: linear-gradient(135deg, var(--gc-primary) 0%, var(--gc-secondary) 100%);
	border: none;
	border-radius: 50%;
	width: 56px;
	height: 56px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: var(--gc-white);
	transition: var(--gc-transition);
	box-shadow: 0 4px 12px rgba(251, 186, 3, 0.4), 0 2px 6px rgba(49, 221, 148, 0.3);
}

.gc-swap-btn::before {
	content: '';
	position: absolute;
	width: 56px;
	height: 56px;
	background: linear-gradient(135deg, var(--gc-secondary) 0%, var(--gc-primary) 100%);
	border-radius: 50%;
	opacity: 0;
	transition: var(--gc-transition);
	z-index: -1;
}

.gc-swap-btn:hover {
	transform: rotate(180deg) scale(1.1);
	box-shadow: 0 6px 16px rgba(251, 186, 3, 0.5), 0 3px 8px rgba(49, 221, 148, 0.4);
}

.gc-swap-btn:hover::before {
	opacity: 1;
}

.gc-swap-btn:active {
	transform: rotate(180deg) scale(1);
	box-shadow: 0 3px 10px rgba(251, 186, 3, 0.4), 0 2px 5px rgba(49, 221, 148, 0.3);
}

.gc-swap-btn:focus {
	outline: none;
	box-shadow: 0 4px 12px rgba(251, 186, 3, 0.4), 0 2px 6px rgba(49, 221, 148, 0.3), 0 0 0 4px rgba(251, 186, 3, 0.3);
}

.gc-swap-btn svg {
	transition: var(--gc-transition);
	stroke: var(--gc-white);
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.gc-swap-btn:hover svg {
	stroke: var(--gc-white);
}

/* ========================================
   Convert Button
   ======================================== */
.gc-btn {
	background: linear-gradient(135deg, var(--gc-primary) 0%, var(--gc-secondary) 100%);
	color: var(--gc-white);
	padding: 18px 32px;
	border-radius: var(--gc-border-radius-sm);
	font-size: 1.2rem;
	font-weight: 800;
	cursor: pointer;
	margin-top: 10px;
	text-transform: uppercase;
	letter-spacing: 1px;
	position: relative;
	border: none;
	transition: var(--gc-transition);
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 64px;
	box-shadow: 0 6px 20px rgba(251, 186, 3, 0.4), 0 2px 8px rgba(49, 221, 148, 0.3);
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.gc-btn::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(135deg, var(--gc-secondary) 0%, var(--gc-primary) 100%);
	opacity: 0;
	transition: var(--gc-transition);
	border-radius: var(--gc-border-radius-sm);
	z-index: -1;
}

.gc-btn-text {
	color: var(--gc-white);
	font-weight: 800;
	position: relative;
	z-index: 2;
}

.gc-btn:hover {
	transform: translateY(-3px) scale(1.02);
	box-shadow: 0 12px 30px rgba(251, 186, 3, 0.5), 0 4px 12px rgba(49, 221, 148, 0.4);
}

.gc-btn:hover::before {
	opacity: 1;
}

.gc-btn:active {
	transform: translateY(-1px) scale(1);
	box-shadow: 0 4px 15px rgba(251, 186, 3, 0.4), 0 2px 6px rgba(49, 221, 148, 0.3);
}

.gc-btn:focus {
	outline: none;
	box-shadow: 0 6px 20px rgba(251, 186, 3, 0.4), 0 2px 8px rgba(49, 221, 148, 0.3), 0 0 0 4px rgba(251, 186, 3, 0.3);
}

.gc-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gc-btn:disabled:hover {
	transform: none;
	box-shadow: none;
}

/* Loading Spinner */
.gc-spinner {
	animation: rotate 2s linear infinite;
	width: 24px;
	height: 24px;
}

.gc-spinner .path {
	stroke: var(--gc-primary);
	stroke-linecap: round;
	animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
	100% {
		transform: rotate(360deg);
	}
}

@keyframes dash {
	0% {
		stroke-dasharray: 1, 150;
		stroke-dashoffset: 0;
	}

	50% {
		stroke-dasharray: 90, 150;
		stroke-dashoffset: -35;
	}

	100% {
		stroke-dasharray: 90, 150;
		stroke-dashoffset: -124;
	}
}

/* ========================================
   Result Container
   ======================================== */
.gc-result-container {
	margin-top: 30px;
	padding: 30px;
	background: var(--gc-white);
	border-radius: var(--gc-border-radius);
	text-align: center;
	border: 2px solid transparent;
	background-image: linear-gradient(white, white), linear-gradient(to right, var(--gc-primary), var(--gc-secondary));
	background-origin: border-box;
	background-clip: padding-box, border-box;
	animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.gc-result-label {
	font-size: 0.9rem;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	color: #666;
	margin-bottom: 10px;
	font-weight: 600;
}

.gc-result-value {
	font-size: 3.5rem;
	font-weight: 800;
	line-height: 1.2;
	background: linear-gradient(to right, var(--gc-primary), var(--gc-secondary));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	margin: 10px 0;
	animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gc-result-detail {
	font-size: 1.2rem;
	font-weight: 600;
	margin-top: 10px;
	background: linear-gradient(to right, var(--gc-primary), var(--gc-secondary));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* ========================================
   Error Container
   ======================================== */
.gc-error-container {
	margin-top: 20px;
	padding: 16px 20px;
	background: #fef2f2;
	border: 2px solid var(--gc-error);
	border-radius: var(--gc-border-radius-sm);
	color: var(--gc-error);
	display: flex;
	align-items: center;
	gap: 12px;
	animation: shake 0.5s ease-in-out;
	font-weight: 500;
}

.gc-error-container svg {
	flex-shrink: 0;
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes scaleIn {
	from {
		opacity: 0;
		transform: scale(0.8);
	}

	to {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes shake {

	0%,
	100% {
		transform: translateX(0);
	}

	10%,
	30%,
	50%,
	70%,
	90% {
		transform: translateX(-5px);
	}

	20%,
	40%,
	60%,
	80% {
		transform: translateX(5px);
	}
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
	.gc-container {
		padding: 30px 25px;
	}

	.gc-result-value {
		font-size: 2.8rem;
	}

	.gc-btn {
		font-size: 1rem;
		padding: 14px 20px;
	}
}

@media (max-width: 480px) {
	.gc-wrapper {
		margin: 20px auto;
		padding: 0 15px;
	}

	.gc-container {
		padding: 25px 20px;
	}

	.gc-result-value {
		font-size: 2.5rem;
	}

	.gc-input-group label {
		font-size: 0.9rem;
	}

	.gc-select,
	.gc-input {
		padding: 12px 14px;
		font-size: 0.95rem;
	}

	.gc-btn {
		font-size: 0.95rem;
		padding: 14px 18px;
		letter-spacing: 0.3px;
	}

	.gc-swap-btn {
		width: 44px;
		height: 44px;
	}
}

/* ========================================
   Accessibility Enhancements
   ======================================== */
@media (prefers-reduced-motion: reduce) {

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* High contrast mode support */
@media (prefers-contrast: high) {

	.gc-select,
	.gc-input {
		border-width: 3px;
	}

	.gc-btn {
		border-width: 3px;
	}
}

/* Focus visible for keyboard navigation */
.gc-select:focus-visible,
.gc-input:focus-visible,
.gc-btn:focus-visible,
.gc-swap-btn:focus-visible {
	outline: 3px solid var(--gc-primary);
	outline-offset: 2px;
}