/* Base styles */
* {
    box-sizing: border-box;
}

/* Viewport height fix for mobile browsers */
html {
    font-size: 16px; /* Prevents zoom on iOS when focusing inputs */
    -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape */
    -ms-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding-top: 50px;
    padding-bottom: 50px;
    background-image: url('images/6.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    min-height: -webkit-fill-available; /* iOS Safari fix */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Container width constraint for very wide screens */
.container {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

/* Logo container */
#logo {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Logo image */
.logo {
    width: 150px;
    height: 150px;
    margin-bottom: 40px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

/* Star rating styles */
.star {
    font-size: 3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    user-select: none;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

.star:hover,
.star.highlighted {
    color: #A2C231;
    transform: scale(1.2);
    text-shadow: 0 0 3px #A2C231;
}

#stars {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    padding: 20px;
    flex-wrap: nowrap; /* Prevent wrapping */
}

/* Form styles */
.form-container {
    max-width: 500px;
    width: 100%;
    padding: 0 20px;
}

.form-control {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    transition: all 0.3s ease;
    font-size: 16px !important; /* Prevents zoom on iOS */
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: #A2C231;
    font-size: 16px !important; /* Maintain size on focus */
}

.form-control::placeholder {
    color: #666;
    opacity: 1;
}

/* Button styles */
.btn-submit {
    background: #A2C231;
    border: none;
    color: white;
    padding: 12px 40px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    -webkit-appearance: none; /* Remove iOS button styling */
    appearance: none;
}

.btn-submit:hover:not(:disabled) {
    background: rgb(255, 255, 255);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(122, 204, 95, 0.4);
    color: #000000;
}

.btn-submit:disabled {
    background: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

/* Rating container styles */
.titles-container {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 100%;           /* Ensure full width */
    max-width: none;       /* Remove max-width constraint */
    box-sizing: border-box;/* Include padding in width */
}

.rating-container {
    margin-bottom: 15px;
}

.rating-container:last-child {
    margin-bottom: 0;
}

.food-rating {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.rating-label {
    flex: 0 0 100px;
}

.rating-p {
    margin: 0;
    color: whitesmoke;
    font-weight: 500;
    font-size: 1.1rem;
}

.rating-stars {
    display: flex;
    gap: 8px;
    flex-shrink: 0; /* Prevent stars from shrinking */
    padding: 0 15px;
}

.star-2 {
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.6);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.star-2:hover,
.star-2.highlighted {
    color: #A2C231;
    transform: scale(1.2);
}

/* Text styles */
#title, h1 {
    color: whitesmoke;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: 600;
}

.form-check-label {
    color: whitesmoke;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

    /* Footer styles */
.footer {
    width: 100%;
    padding: 1rem;
    text-align: center;
    margin-top: auto;
}

.footer a {
    color: #A2C231;
    text-decoration: underline;
    font-size: 0.9rem;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.footer a:hover {
    opacity: 1;
    color: #A2C231;
}

/* Star click animation */
/* @keyframes starPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.5) rotate(180deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
    }
} */

@keyframes starBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.2);
    }
}

.star-clicked {
    animation: starPulse 0.6s ease-out;
}

/* .star-bounce {
    animation: starBounce 0.6s ease-out;
} */

/* Mobile responsive styles */
@media (max-width: 768px) {
    html, body {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    body {
        padding-top: calc(110px + env(safe-area-inset-top, 0px)) !important;
        padding-bottom: 30px;
        background-image: url('images/2a_Logowanie.png');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        background-attachment: fixed;
    }
    #logo {
        margin-top: 0 !important;
    }
    .logo {
        width: 120px;
        height: 120px;
        margin-bottom: 30px;
    }
    
    .star {
        font-size: 2.5rem;
    }
    
    #stars {
        gap: 10px;
    }
    
    .titles-container {
        width: 100%;
        position: relative;
        border-radius: 12px;
        max-width: none;
    }
    
    /* Keep rating items in same row on mobile */
    .food-rating {
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
        text-align: left;
    }
    
    .rating-label {
        flex: 0 0 auto;
        margin-bottom: 0 !important;
        min-width: 70px;
    }
    
    .rating-p {
        font-size: 0.95rem;
        margin: 0;
    }
    
    .rating-stars {
        display: flex;
        gap: 5px;
        justify-content: flex-end;
    }
    
    h1 {
        font-size: 1.5rem;
        padding: 0 15px; /* Add padding to prevent edge touching */
    }
    
    .btn-submit {
        width: 100%;
        padding: 15px;
        max-width: 350px; /* Prevent button from being too wide */
    }
    
    /* Ensure thanks page fills screen */
    .vh-100 {
        min-height: 100vh !important;
        min-height: -webkit-fill-available !important;
    }
    


}

@media (max-width: 480px) {
    body {
        padding-top: calc(40px + env(safe-area-inset-top, 0px)) !important;
        padding-bottom: 20px;
    }
    
    .logo {
        width: 100px;
        height: 100px;
        margin-bottom: 20px;
    }
    
    .star {
        font-size: 2rem;
    }
    
    .star-2 {
        font-size: 1.2rem;
    }
    
    #stars {
        gap: 5px;
        padding: 15px;
    }
    
    .rating-stars {
        gap: 3px !important;
    }
    
    .rating-p {
        font-size: 0.9rem;
    }
    
    .rating-label {
        min-width: 60px;
    }
    
    h1 {
        font-size: 1.25rem;
    }
    
    .titles-container {
        padding: 12px;
    }
}

/* Very small devices (iPhone SE, etc.) */
@media (max-width: 375px) {
    .logo {
        width: 80px;
        height: 80px;
    }
    
    .star {
        font-size: 1.75rem;
    }
    
    .star-2 {
        font-size: 1.1rem;
    }
    
    h1 {
        font-size: 1.125rem;
    }
}

/* Landscape orientation fixes */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding-top: 10px;
        padding-bottom: 10px;
    }
    
    .logo {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
    }
    
    .star {
        font-size: 1.5rem;
    }
    
    h1 {
        font-size: 1.125rem;
        margin-bottom: 10px;
    }
    
    #stars {
        padding: 10px;
    }
}

/* Textarea specific styling */
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Checkbox custom styling */
.form-check {
    padding-left: 0;
    margin-left: 25px;
}

.form-check-input {
    width: 20px;
    height: 20px;
    margin-top: 0;
    margin-left: 30;
    background-color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #A2C231;
    border-color: #A2C231;
}

.form-check-label {
    margin-left: 10px;
    cursor: pointer;
}

/* Feedback page visual style (form-only) */
body.feedback-page #logo .logo {
    width: 150px;
    height: 150px;
    margin-bottom: 40px;
    margin-top: 30px;
}

body.feedback-page .form-container {
    max-width: 460px;
    padding: 20px 18px 16px;
    border-radius: 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.78);
    background: rgba(18, 24, 34, 0.78);
    box-shadow:
        0 0 22px rgba(255, 255, 255, 0.34),
        0 10px 35px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

body.feedback-page .titles-container {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0 0 10px;
    margin-bottom: 12px;
}

body.feedback-page .food-rating {
    padding: 6px 0;
}

body.feedback-page .rating-p {
    font-size: 0.98rem;
}

body.feedback-page .form-control {
    min-height: 40px;
    border-radius: 10px;
    border: 1.3px solid rgba(255, 255, 255, 0.78);
    background: rgba(14, 18, 24, 0.5);
    color: #f4f4f4;
}

body.feedback-page textarea.form-control {
    min-height: 78px;
}

body.feedback-page .form-control::placeholder {
    color: rgba(255, 255, 255, 0.62);
}

body.feedback-page .form-control:focus {
    background: #ffffff;
    color: #161616;
    border-color: #ffffff;
    box-shadow: 0 0 0 0.18rem rgba(255, 255, 255, 0.28);
}



body.feedback-page .btn-submit {
    width: 100%;
    max-width: none;
    border-radius: 10px;
    padding: 11px 20px;
}

body.feedback-page .form-check-label {
    font-size: 0.78rem;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Smooth transitions for all interactive elements */
input, textarea, button, .star, .star-2 {
    transition: all 0.3s ease;
}

/* Prevent zoom on input focus (iOS) */
input[type="text"],
input[type="tel"],
input[type="email"],
textarea,
select {
    font-size: 16px !important;
}

/* Ensure no horizontal scrolling */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Fix for iOS Safari viewport */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }
    
    .vh-100 {
        min-height: -webkit-fill-available !important;
    }
}