/* Modern Color Scheme */
:root {
    --primary-purple: #4c4dcf;
    --light-purple: #7a7beb;
    --dark-blue: #1a2b4a;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --white: #ffffff;
    --text-dark: #333333;
    
    /* Dark mode variables */
    --bg-dark: #121212;
    --text-light: #f5f5f5;
    --card-dark: #1e1e1e;
    --border-dark: #333333;
}

/* Base Styles with transitions */
html {
    scroll-behavior: smooth;
    transition: background-color 0.3s ease;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light-gray);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease;
}

.dark-mode body {
    background-color: var(--bg-dark);
    color: var(--text-light);
}

/* Container Layout */
.container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    transition: background-color 0.3s ease;
}

/* Header Styles */
header {
    width: 100%;
    padding: 1.5rem 0;
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.dark-mode header {
    background-color: var(--card-dark);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    height: 40px;
    width: auto;
    transition: filter 0.3s ease;
}

.dark-mode .logo {
    filter: brightness(0.8) contrast(1.2);
}

h1 {
    font-size: 1.8rem;
    color: var(--dark-blue);
    margin: 0;
    font-weight: 700;
    transition: color 0.3s ease;
}

.dark-mode h1 {
    color: var(--text-light);
}

/* Main Content Area */
main {
    flex: 1;
    width: 100%;
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    box-sizing: border-box;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.dark-mode main {
    background-color: var(--card-dark);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.form-header h2 {
    color: var(--dark-blue);
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
    transition: color 0.3s ease;
}

.dark-mode .form-header h2 {
    color: var(--text-light);
}

/* Form Sections */
.personal-info-section,
.ratings-section,
.review-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--medium-gray);
    transition: border-color 0.3s ease;
}

.dark-mode .personal-info-section,
.dark-mode .ratings-section,
.dark-mode .review-section {
    border-bottom-color: var(--border-dark);
}

.review-section {
    border-bottom: none;
}

h3 {
    color: var(--dark-blue);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    transition: color 0.3s ease;
}

.dark-mode h3 {
    color: var(--text-light);
}

/* Form Rows */
.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.form-group {
    flex: 1;
    margin-bottom: 1rem;
    min-width: 0;
}

/* Input Fields */
input[type="text"],
input[type="email"],
input[type="url"],
select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.9rem 1.2rem;
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: var(--white);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.dark-mode input[type="text"],
.dark-mode input[type="email"],
.dark-mode input[type="url"],
.dark-mode select {
    background-color: var(--card-dark);
    border-color: var(--border-dark);
    color: var(--text-light);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23333333' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 2.5rem;
}

.dark-mode select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23f5f5f5' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(76, 77, 207, 0.2);
}

/* Placeholder styling for select */
select:invalid {
    color: #6c757d;
}

.dark-mode select:invalid {
    color: #9e9e9e;
}

select option {
    color: var(--text-dark);
    background-color: var(--white);
}

.dark-mode select option {
    color: var(--text-light);
    background-color: var(--card-dark);
}

select option[value=""][disabled] {
    display: none;
}

/* Rating System */
.rating-category {
    margin-bottom: 1.8rem;
}

.rating-label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: var(--dark-blue);
    transition: color 0.3s ease;
}

.dark-mode .rating-label {
    color: var(--text-light);
}

.rating-group {
    display: flex;
    gap: 0.8rem;
}

.rating-option {
    flex: 1;
}

.rating-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.rating-option label {
    display: block;
    padding: 0.8rem;
    background: var(--light-gray);
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.dark-mode .rating-option label {
    background: var(--border-dark);
}

.rating-option label:hover {
    background: var(--medium-gray);
}

.dark-mode .rating-option label:hover {
    background: #2a2a2a;
}

.rating-option input[type="radio"]:checked + label {
    background: var(--primary-purple);
    color: var(--white);
}

/* Review Box */
.review-box {
    width: 100%;
    min-height: 250px;
    padding: 1.2rem;
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    margin-bottom: 1.5rem;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background-color: var(--white);
}

.dark-mode .review-box {
    background-color: var(--card-dark);
    border-color: var(--border-dark);
    color: var(--text-light);
}

.review-box:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(76, 77, 207, 0.2);
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-purple);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    box-sizing: border-box;
}

.submit-btn:hover {
    background: var(--light-purple);
    transform: translateY(-2px);
}

/* Footer */
footer {
    width: 100%;
    background: var(--dark-blue);
    color: var(--white);
    padding: 2rem 0;
    margin-top: auto;
    transition: background-color 0.3s ease;
}

.dark-mode footer {
    background-color: var(--card-dark);
}

footer nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

footer a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--light-purple);
}

.copyright {
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    top: 25px;
    right: 25px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-dark);
    padding: 10px;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
}

.dark-mode .dark-mode-toggle {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.1);
}

.dark-mode .dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.dark-mode-toggle .fa-sun {
    display: none;
}

.dark-mode-toggle .fa-moon {
    display: inline;
}

.dark-mode .dark-mode-toggle .fa-sun {
    display: inline;
    color: #FFD700;
}

.dark-mode .dark-mode-toggle .fa-moon {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        width: calc(100% - 30px);
        padding: 0 15px;
    }

    .form-row {
        flex-direction: column;
        gap: 1rem;
    }

    .rating-group {
        flex-wrap: wrap;
    }

    .rating-option {
        min-width: calc(20% - 0.8rem);
    }

    main {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .rating-option label {
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    footer nav {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .dark-mode-toggle {
        top: 15px;
        right: 15px;
    }
}