* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --quiyet-primary: #4a90e2;
    --quiyet-secondary: #7b68ee;
    --quiyet-accent: #50c878;
    --quiyet-dark: #2c3e50;
    --quiyet-light: #f8fafc;
    --quiyet-gradient: linear-gradient(135deg, #4a90e2 0%, #7b68ee 100%);
    --quiyet-text: #2c3e50;
    --quiyet-muted: #64748b;
}

body {
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
    line-height: 1.6;
    color: var(--quiyet-text);
    background: var(--quiyet-gradient);
    min-height: 100vh;
}

/* Quando font class with robust fallback */
.quando-regular {
    font-family: "Quando", "Quando-Local", "Georgia", "Times New Roman", serif;
    font-weight: 400;
    font-style: normal;
}

/* Font loading states */
.fonts-loading .quando-regular {
    font-family: "Georgia", "Times New Roman", serif;
}

.fonts-failed .quando-regular {
    font-family: "Quando-Local", "Georgia", "Times New Roman", serif;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    color: white;
    height: 200px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background-color 0.3s ease,
        backdrop-filter 0.3s ease,
        box-shadow 0.3s ease,
        height 0.3s ease;
}

.logo {
    position: absolute;
    left: calc(50% - 380px);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.tagline {
    position: absolute;
    left: calc(50% - 200px);
    top: 40%;
    transform: translateY(-50%);
    font-family: "Quando", "Quando-Local", "Georgia", "Times New Roman", serif;
    font-size: 1.1rem;
    font-weight: 400;
    opacity: 0.9;
    white-space: nowrap;
}

.logo-image {
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: left center;
    width: 150px;
    max-width: 150px;
}

.logo h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    color: white;
}

.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 101;
}

.language-selector select {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    color: white;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-family: inherit;
    backdrop-filter: blur(10px);
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.language-selector select:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.language-selector select:focus {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.language-selector option {
    background: var(--quiyet-dark);
    color: white;
    padding: 8px;
}

.tagline {
    font-family: "Quando", "Quando-Local", "Georgia", "Times New Roman", serif;
    font-size: 1.1rem;
    font-weight: 400;
    opacity: 0.9;
    margin-bottom: 35px;
}

.location-status {
    position: absolute;
    left: calc(50% - 200px);
    top: 60%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
    white-space: nowrap;
}

.location-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    flex-shrink: 0;
}

#locationText {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

#locationText:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.main {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 200px;
    transition: margin-top 0.3s ease;
}

@media (max-width: 768px) {
    .header {
        height: 150px;
        min-height: 70px;
    }

    .main {
        margin-top: 150px;
    }

    .tagline {
        left: calc(50% - 320px);
        font-size: 1rem;
    }

    .location-status {
        left: calc(50% - 320px);
        top: 60%;
    }

    .language-selector {
        top: 15px;
        right: 15px;
    }

    .language-selector select {
        font-size: 0.8rem;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .language-selector select {
        padding: 6px 12px;
    }
    .header {
        height: 120px;
        min-height: 60px;
    }

    .main {
        margin-top: 120px;
    }

    .tagline {
        left: calc(50% - 180px);
        font-size: 0.8rem;
        top: 35%;
    }

    .location-status {
        left: calc(50% - 180px);
        font-size: 0.75rem;
        padding: 6px 14px;
        top: 65%;
        max-width: 200px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 400px) {
    .tagline {
        left: calc(50% - 160px);
        font-size: 0.85rem;
        top: 30%;
    }

    .location-status {
        left: calc(50% - 160px);
        font-size: 0.75rem;
        padding: 6px 12px;
        top: 70%;
        max-width: 240px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .language-selector {
        top: 8px;
        right: 8px;
    }

    .language-selector select {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}

.update-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--quiyet-primary);
    color: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
    max-width: 400px;
    backdrop-filter: blur(10px);
}

.update-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.update-icon {
    font-size: 1.2rem;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.update-button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.update-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.update-dismiss {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: underline;
}

.update-dismiss:hover {
    color: white;
}

@media (max-width: 480px) {
    .update-message {
        left: 10px;
        right: 10px;
        transform: none;
        max-width: none;
    }

    .update-content {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
}

.card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.card h2 {
    font-family: "Quando", "Quando-Local", "Georgia", "Times New Roman", serif;
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: #2c3e50;
    font-weight: 400;
}

.location-info {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.location-name input,
.location-type select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: #f8fafc;
}

.location-name input:focus,
.location-type select:focus {
    outline: none;
    border-color: var(--quiyet-primary);
    background: white;
}

.location-name input:focus {
    border-radius: 12px 12px 0 0;
}

.location-name input:focus + .autocomplete-suggestions {
    border-color: var(--quiyet-primary);
}

.rating-criteria {
    margin-bottom: 30px;
}

.criterion {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e1e8ed;
}

.criterion:last-child {
    border-bottom: none;
}

.criterion label,
.criterion .rating-label {
    display: block;
    font-family: "Quando", "Quando-Local", "Georgia", "Times New Roman", serif;
    font-weight: 400;
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1.1rem;
}

.rating-stars {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
}

.star {
    font-size: 2rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s ease;
    user-select: none;
}

.star:hover,
.star.active {
    color: #ffd700;
}

.star.hover {
    color: #ffed4a;
}

.criterion small {
    color: #6b7280;
    font-size: 0.85rem;
}

.comment-section {
    margin-bottom: 25px;
}

.comment-section label {
    display: block;
    font-family: "Quando", "Quando-Local", "Georgia", "Times New Roman", serif;
    font-weight: 400;
    margin-bottom: 10px;
    color: #2c3e50;
}

.comment-section textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    background: #f8fafc;
    transition: border-color 0.3s ease;
}

.comment-section textarea:focus {
    outline: none;
    border-color: var(--quiyet-primary);
    background: white;
}

.tags-section label {
    display: block;
    font-family: "Quando", "Quando-Local", "Georgia", "Times New Roman", serif;
    font-weight: 400;
    margin-bottom: 15px;
    color: #2c3e50;
}

.tags-section fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

.tags-section legend {
    font-family: "Quando", "Quando-Local", "Georgia", "Times New Roman", serif;
    font-weight: 400;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1rem;
}

.tags {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 30px;
}

.tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.9rem;
}

.tag:hover {
    background: #e2e8f0;
}

.tag input[type="checkbox"] {
    margin: 0;
    transform: scale(1.2);
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: var(--quiyet-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: "Quando", "Quando-Local", "Georgia", "Times New Roman", serif;
    font-size: 1.1rem;
    font-weight: 400;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.recent-ratings h3 {
    font-family: "Quando", "Quando-Local", "Georgia", "Times New Roman", serif;
    color: white;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 400;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.ratings-list {
    display: grid;
    gap: 15px;
}

.rating-item {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.rating-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.rating-name {
    font-family: "Quando", "Quando-Local", "Georgia", "Times New Roman", serif;
    font-weight: 400;
    font-size: 1.1rem;
    color: #2c3e50;
}

.rating-type {
    background: #e2e8f0;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #64748b;
    margin-left: auto;
}

.rating-scores {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.score {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.score-label {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 2px;
}

.score-stars {
    color: #ffd700;
    font-size: 0.9rem;
}

.rating-comment {
    color: #4b5563;
    font-size: 0.9rem;
    margin-top: 10px;
    font-style: italic;
}

.success-message {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.success-message.show {
    display: flex;
}

.success-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 300px;
}

.success-icon {
    display: inline-block;
    width: 50px;
    height: 50px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    line-height: 50px;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.success-content p {
    margin-bottom: 20px;
    color: #374151;
}

.close-success {
    background: var(--quiyet-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: "Quando", "Quando-Local", "Georgia", "Times New Roman", serif;
    font-weight: 400;
}

.loading {
    opacity: 0.7;
    pointer-events: none;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .logo h1 {
        font-size: 2.5rem;
    }

    .card {
        padding: 20px;
    }

    .tags {
        grid-template-columns: 1fr;
    }

    .rating-scores {
        justify-content: space-around;
    }

    .location-status {
        font-size: 0.8rem;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 2rem;
    }

    .star {
        font-size: 1.8rem;
    }

    .rating-scores {
        gap: 15px;
    }
}

/* Smooth animations */
.card,
.rating-item {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tag badges for ratings display */
.rating-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tag-badge {
    background: #e2e8f0;
    color: #475569;
    padding: 4px 8px;
    border-radius: 12px;
    font-family: "Quando", "Quando-Local", "Georgia", "Times New Roman", serif;
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: capitalize;
}

/* Autocomplete styles */
.location-name {
    position: relative;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e1e8ed;
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background-color: #f8fafc;
}

.suggestion-main {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.suggestion-icon {
    font-size: 0.9rem;
    opacity: 0.7;
}

.suggestion-name {
    flex: 1;
    font-weight: 500;
}

.suggestion-name strong {
    background-color: #fef3c7;
    padding: 1px 2px;
    border-radius: 2px;
}

.suggestion-type {
    font-size: 0.8rem;
    color: var(--quiyet-muted);
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 12px;
}

.suggestion-rating {
    font-size: 0.8rem;
    color: #ffd700;
    margin-bottom: 2px;
}

.suggestion-address {
    font-size: 0.75rem;
    color: var(--quiyet-muted);
    margin-left: 24px;
    font-style: italic;
}

.suggestion-distance {
    font-size: 0.75rem;
    color: var(--quiyet-primary);
    margin-left: 24px;
    font-weight: 500;
}

.autocomplete-header {
    padding: 8px 16px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.8rem;
    color: var(--quiyet-muted);
    font-weight: 500;
    text-align: center;
    margin: 0;
}

/* Autocomplete responsive */
@media (max-width: 768px) {
    .autocomplete-suggestions {
        max-height: 250px;
    }

    .autocomplete-item {
        padding: 10px 12px;
    }

    .suggestion-main {
        flex-wrap: wrap;
    }

    .suggestion-type {
        font-size: 0.75rem;
    }
}

/* Focus styles for accessibility */
.star:focus,
.submit-btn:focus,
.close-success:focus,
.autocomplete-item:focus {
    outline: 2px solid var(--quiyet-primary);
    outline-offset: 2px;
}

/* Additional responsive adjustments handled above */

/* Location status enhancements */
.location-loading {
    color: rgba(255, 255, 255, 0.8);
    animation: locationPulse 1.5s infinite;
}

.location-found {
    color: #50c878;
    font-weight: 500;
}

.location-error {
    color: #ff6b6b;
    font-weight: 500;
}

@keyframes locationPulse {
    0%,
    100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Enhanced success message */
.success-icon {
    animation: successBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes successBounce {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* API Integration Styles */
.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 16px;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
}

.error-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.error-icon {
    font-size: 1.2rem;
    color: #ef4444;
}

.error-content p {
    flex: 1;
    color: #dc2626;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

.error-content button {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    margin-left: 8px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.error-content button:hover {
    opacity: 1;
}

.offline-message {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fbbf24;
    color: #92400e;
    padding: 8px 16px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 1000;
    display: none;
    animation: slideInDown 0.3s ease-out;
}

.offline-icon {
    margin-right: 8px;
}

.sync-pending {
    color: #f59e0b;
    font-size: 0.75rem;
    font-weight: 500;
    background: #fef3c7;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 8px;
}

/* Animation keyframes */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Loading states */
.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.submit-btn.loading::after {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments for API integration elements */
@media (max-width: 768px) {
    .error-message {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .offline-message {
        padding: 12px 16px;
        font-size: 0.85rem;
    }
}
