/**
 * UTK GPA Calculator - Frontend Styles
 */

/* Reset and base styles - inherit from WordPress theme */
.utk-gpa-calculator-wrapper * {
    box-sizing: border-box;
}

.utk-gpa-calculator-wrapper {
    /* Inherit all typography from WordPress theme */
    font-family: inherit;
    line-height: inherit;
    color: inherit;
}

/* Calculator wrapper - no constraints for WordPress block container usage */
.utk-gpa-calculator-wrapper {
    width: 100%;
}

/* GPA Calculator Styles */
.gpa-calculator-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.grade-entry-section {
    padding: 24px;
    border: 1px #D9D9D9 solid;
}

.courses-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.course-row {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 20px;
    align-items: end;
}

/* UTK Form Controls - Exact implementation from style-index.css */
.form-floating {
    position: relative;
    width: 100%;
}

.form-control {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-clip: padding-box;
    background-color: #fff;
    border: 1px solid #949494;
    border-radius: 0.375rem;
    color: #212529;
    display: block;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    padding: .375rem 15px;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    width: 100%;
}

.form-control:focus {
    background-color: #fff;
    border-color: #1a73c5;
    box-shadow: 0 0 0 .25rem rgba(26,115,197,.3);
    color: #212529;
    outline: 0;
}

.form-select {
    --bs-form-select-bg-img: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27%3E%3Cpath fill=%27none%27 stroke=%27%23343a40%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%272%27 d=%27m2 5 6 6 6-6%27/%3E%3C/svg%3E");
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27%3E%3Cpath fill=%27none%27 stroke=%27%23343a40%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%272%27 d=%27m2 5 6 6 6-6%27/%3E%3C/svg%3E"), var(--bs-form-select-bg-icon, none);
    background-position: right 15px center;
    background-repeat: no-repeat;
    background-size: 16px 16px;
    border: 1px solid #949494;
    border-radius: 0.375rem;
    color: #212529;
    display: block;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    padding: .375rem 45px .375rem 15px;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    width: 100%;
}

.form-select:focus {
    border-color: #1a73c5;
    box-shadow: 0 0 0 .25rem rgba(26,115,197,.3);
    outline: 0;
}

.form-floating > .form-control,
.form-floating > .form-control-plaintext,
.form-floating > .form-select {
    height: calc(3.5rem + 1px * 2);
    line-height: 1.25;
    min-height: calc(3.5rem + 1px * 2);
}

.form-floating > label {
    border: 1px solid transparent;
    color: rgba(33,37,41, .65);
    height: 100%;
    left: 0;
    max-width: 100%;
    overflow: hidden;
    padding: 1rem 15px;
    pointer-events: none;
    position: absolute;
    text-align: start;
    text-overflow: ellipsis;
    top: 0;
    transform-origin: 0 0;
    transition: opacity .1s ease-in-out, transform .1s ease-in-out;
    white-space: nowrap;
    z-index: 2;
    font-size: 1rem;
}

.form-floating > .form-control,
.form-floating > .form-control-plaintext {
    padding: 1rem 15px;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-control-plaintext ~ label,
.form-floating > .form-select ~ label {
    transform: scale(.85) translateY(-.5rem) translateX(.15rem);
}

.form-floating > .form-control::-moz-placeholder,
.form-floating > .form-control-plaintext::-moz-placeholder {
    color: transparent;
}

.form-floating > .form-control::placeholder,
.form-floating > .form-control-plaintext::placeholder {
    color: transparent;
}


.form-floating > .credits-input:focus::placeholder {
    transform: scale(.85) translateY(-.5rem) translateX(.15rem);
}

.form-floating > .form-control:not(:-moz-placeholder),
.form-floating > .form-control-plaintext:not(:-moz-placeholder) {
    padding-bottom: .625rem;
    padding-top: 1.625rem;
}

.form-floating > .form-control:focus,
.form-floating > .form-control:not(:placeholder-shown),
.form-floating > .form-control-plaintext:focus,
.form-floating > .form-control-plaintext:not(:placeholder-shown) {
    padding-bottom: .625rem;
    padding-top: 1.625rem;
}

.form-floating > .form-select {
    padding-bottom: .625rem;
    padding-left: 15px;
    padding-top: 1.625rem;
}

select.form-select {
    color: inherit;
}

/* WordPress Block Button Styles */
.wp-block-button {
    display: inline-block;
}

.wp-block-button .wp-block-button__link {
    background-color: var(--wp--preset--color--white, #ffffff);
    border-radius: .45rem;
    border-color: var(--wp--preset--color--orange, #ff8200);
    border-width: .125rem;
    border-style: solid;
    color: var(--wp--custom--color--river, #1a73c5);
    padding-top: .66em;
    padding-right: 1.33em;
    padding-bottom: .66em;
    padding-left: 1.33em;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    font-family: inherit;
    font-weight: inherit;
    font-size: 20px;
    line-height: 1.5;
}

.wp-block-button .wp-block-button__link:hover,
.wp-block-button .wp-block-button__link:focus,
.wp-block-button .wp-block-button__link:active {
    background-color: var(--wp--preset--color--white, #ffffff);
    border-color: var(--wp--preset--color--orange, #ff8200);
    color: var(--wp--custom--color--river, #1a73c5);
}

.wp-block-button .wp-block-button__link:disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Secondary button (Add Another Grade) - smaller variant */
.wp-block-button.is-style-secondary .wp-block-button__link {
    font-size: 16px;
    padding-top: .5em;
    padding-right: 1em;
    padding-bottom: .5em;
    padding-left: 1em;
}

/* Remove button - styled as UTK theme link */
.utk-button-ghost {
    background: transparent;
    border: none;
    color: #1a73c5;
    font-family: inherit;
    font-size: 16px;
    font-style: normal;
    font-weight: inherit;
    line-height: normal;
    text-decoration-line: underline;
    text-decoration-style: solid;
    text-decoration-skip-ink: none;
    text-decoration-thickness: auto;
    text-underline-offset: auto;
    text-underline-position: from-font;
    padding: 4px 0;
    height: auto;
    cursor: pointer;
}

.utk-button-ghost:hover {
    color: #155a9a;
}


/* Calculate section */
.calculate-section {
    display: flex;
    justify-content: flex-start;
    padding-top: 16px;
}

/* Results section */
.results-section {
    border: 1px solid #d1d5db;
    padding: 24px;
    background: #f6f6f6;
}

.results-title {
    color: inherit;
    font-size: 18px;
    margin: 0 0 12px 0;
    font-family: inherit;
}

.results-content {
    color: inherit;
    font-family: inherit;
}

.results-content p {
    margin: 0;
    font-size: 16px;
}

#gpa-value {
    font-weight: inherit;
}

/* Disclaimer */
.disclaimer {
    font-size: 14px;
    font-style: italic;
    color: rgba(33, 37, 41, .65);
    line-height: 1.4;
    font-family: inherit;
}

/* Responsive design */
@media (max-width: 768px) {
    .course-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .course-actions {
        justify-self: start;
    }
    
    .results-section {
        padding: 16px;
    }
    
    .courses-container {
        gap: 16px;
    }
}