/* Main container */
.app-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.app-header {
    text-align: center;
    padding: 3rem 1rem;
}

/* Sections */
.calculator-section,
.chart-section,
.summary-section,
.info-section {
    background: rgba(10, 10, 21, 0.85);
    border: 2px solid rgba(155, 179, 224, 0.3);
    border-radius: 20px;
    padding: 2.5rem;
    margin: 2rem auto;
    max-width: 1200px;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 50px rgba(155, 179, 224, 0.1);
}

.calculator-section {
    max-width: 800px;
}

.section-title {
    color: #9bb3e0;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Form styles */
.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.75rem;
}

.label-text {
    color: #9bb3e0;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.label-hint {
    color: #888;
    font-size: 0.85rem;
    font-style: italic;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.85rem;
    background: rgba(155, 179, 224, 0.1);
    border: 1px solid rgba(155, 179, 224, 0.3);
    border-radius: 8px;
    color: #e0e0e0;
    font-family: 'Play', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#target-search,
#location-search {
    margin-bottom: 0.5rem;
}

.search-container {
    position: relative;
    margin-bottom: 0.5rem;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 10, 21, 0.98);
    border: 1px solid rgba(155, 179, 224, 0.4);
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.search-results.hidden {
    display: none;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(155, 179, 224, 0.1);
    transition: background 0.2s ease;
}

.search-result-item:hover {
    background: rgba(155, 179, 224, 0.15);
}

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

.search-result-name {
    color: #e0e0e0;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.search-result-details {
    color: #888;
    font-size: 0.85rem;
}

.search-loading {
    padding: 1rem;
    text-align: center;
    color: #9bb3e0;
    font-style: italic;
}

.search-error {
    padding: 1rem;
    text-align: center;
    color: #ff6b6b;
    font-size: 0.9rem;
}

.search-result-group-header {
    padding: 0.5rem 1rem;
    background: rgba(155, 179, 224, 0.2);
    color: #9bb3e0;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(155, 179, 224, 0.3);
}

.search-result-custom {
    background: rgba(155, 179, 224, 0.05);
    border-top: 2px solid rgba(155, 179, 224, 0.2);
}

#target-select option {
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 2px;
}

#target-select optgroup {
    font-weight: bold;
    color: #9bb3e0;
    margin-top: 0.5rem;
}

.target-match {
    background: rgba(155, 179, 224, 0.2);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #9bb3e0;
    background: rgba(155, 179, 224, 0.15);
    box-shadow: 0 0 10px rgba(155, 179, 224, 0.3);
}

.form-group input::placeholder {
    color: #666;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.custom-inputs {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-family: 'Play', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-top: 0.5rem;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(155, 179, 224, 0.2);
    color: #9bb3e0;
    border: 1px solid rgba(155, 179, 224, 0.4);
}

.btn-secondary:hover {
    background: rgba(155, 179, 224, 0.3);
    border-color: #9bb3e0;
}

/* Error messages */
.error-container {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.4);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.error-message {
    color: #ff6b6b;
    font-size: 0.9rem;
    margin: 0.25rem 0;
}

.app-error {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.4);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

/* Chart styles */
.chart-header {
    text-align: center;
    margin-bottom: 1rem;
}

.chart-subtitle {
    font-size: 1rem;
    color: #c0c0c0;
    margin: 0.75rem 0;
    font-style: italic;
    min-height: 1.5rem;
}

.chart-note {
    font-size: 0.9rem;
    color: #9bb3e0;
    margin-top: 0.5rem;
    font-style: italic;
}

.chart-wrapper {
    position: relative;
}

.chart-container {
    min-height: 500px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.chart-controls {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 10;
}

.toggle-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(155, 179, 224, 0.15);
    border: 1px solid rgba(155, 179, 224, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-control:hover {
    background: rgba(155, 179, 224, 0.25);
    border-color: #9bb3e0;
}

.toggle-control input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    margin: 0;
}

.toggle-label {
    color: #9bb3e0;
    font-size: 0.85rem;
    font-family: 'Play', sans-serif;
    cursor: pointer;
    user-select: none;
}

.btn-export {
    padding: 0.5rem 0.75rem;
    background: rgba(155, 179, 224, 0.15);
    color: #9bb3e0;
    border: 1px solid rgba(155, 179, 224, 0.3);
    font-size: 0.85rem;
    min-width: 80px;
}

.btn-export:hover {
    background: rgba(155, 179, 224, 0.25);
    border-color: #9bb3e0;
}

.chart-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

/* Summary styles */
.summary-content {
    color: #c0c0c0;
    line-height: 1.8;
}

.placeholder-text {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 2rem 0;
}

.summary-stats {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(155, 179, 224, 0.1);
    border-radius: 10px;
}

.stat-item {
    font-size: 1.1rem;
    margin: 0.5rem 0;
}

.stat-label {
    color: #9bb3e0;
    font-weight: 600;
}

.stat-value {
    color: #51cf66;
    font-weight: 700;
}

.best-dates,
.worst-dates,
.no-best-dates {
    margin: 1.5rem 0;
    padding: 1.5rem;
    border-radius: 10px;
}

.best-dates {
    background: rgba(81, 207, 102, 0.1);
    border: 1px solid rgba(81, 207, 102, 0.3);
}

.best-dates h3 {
    color: #51cf66;
    margin-bottom: 0.5rem;
}

.worst-dates {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.worst-dates h3 {
    color: #ff6b6b;
    margin-bottom: 0.5rem;
}

.no-best-dates {
    background: rgba(155, 179, 224, 0.1);
    border: 1px solid rgba(155, 179, 224, 0.3);
}

.no-best-dates h3 {
    color: #9bb3e0;
    margin-bottom: 0.5rem;
}

.description {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 0.75rem;
}

.date-list {
    font-size: 1rem;
    color: #e0e0e0;
    line-height: 1.6;
}

.more-dates {
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
    margin-top: 0.5rem;
}

/* Info section */
.info-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-item {
    background: rgba(155, 179, 224, 0.05);
    border: 1px solid rgba(155, 179, 224, 0.15);
    border-radius: 10px;
    padding: 1.5rem;
}

.info-item h3 {
    color: #9bb3e0;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.info-item p {
    color: #c0c0c0;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.info-item strong {
    color: #9bb3e0;
    font-weight: 600;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 3rem 1rem 2rem;
}

.footer-content {
    font-size: 0.9rem;
    color: #888;
}

.footer-link {
    color: #9bb3e0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #ffffff;
}

.divider {
    margin: 0 0.75rem;
    color: #666;
}

/* Modal styles */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: rgba(10, 10, 21, 0.95);
    border: 2px solid rgba(155, 179, 224, 0.4);
    border-radius: 15px;
    padding: 2.5rem;
    max-width: 600px;
    width: 90%;
    position: relative;
    box-shadow: 0 0 50px rgba(155, 179, 224, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    color: #9bb3e0;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.modal-content h3 {
    color: #9bb3e0;
    font-size: 1.3rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.modal-content p {
    color: #c0c0c0;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.modal-close {
    color: #9bb3e0;
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #ffffff;
}

/* Contact form styles */
.modal-content form .form-group {
    margin-bottom: 1.5rem;
}

.modal-content form label {
    display: block;
    color: #9bb3e0;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.modal-content form input[type="text"],
.modal-content form input[type="email"],
.modal-content form textarea {
    width: 100%;
    padding: 0.75rem;
    background: rgba(155, 179, 224, 0.1);
    border: 1px solid rgba(155, 179, 224, 0.3);
    border-radius: 8px;
    color: #e0e0e0;
    font-family: 'Play', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.modal-content form input:focus,
.modal-content form textarea:focus {
    outline: none;
    border-color: #9bb3e0;
    background: rgba(155, 179, 224, 0.15);
    box-shadow: 0 0 10px rgba(155, 179, 224, 0.3);
}

.modal-content form textarea {
    resize: vertical;
    min-height: 100px;
}

.form-message {
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    text-align: center;
}

.form-message p {
    margin: 0;
    font-weight: 600;
}

#form-success {
    background: rgba(81, 207, 102, 0.15);
    border: 1px solid rgba(81, 207, 102, 0.4);
    color: #51cf66;
}

#form-error {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.4);
    color: #ff6b6b;
}

/* Responsive design */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }

    .app-header {
        padding: 2rem 0.5rem;
    }

    .calculator-section,
    .chart-section,
    .summary-section,
    .info-section {
        padding: 1.5rem;
        margin: 1.5rem auto;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .chart-container {
        min-height: 400px;
    }

    .chart-controls {
        bottom: 10px;
        right: 10px;
    }

    .toggle-control {
        padding: 0.4rem 0.6rem;
    }

    .toggle-label {
        font-size: 0.75rem;
    }

    .btn-export {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
        min-width: 70px;
    }

    .info-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.25rem;
    }

    .chart-container {
        min-height: 350px;
    }

    .info-item {
        padding: 1rem;
    }
}
