/* sproduct.css */

/* Product Container */
.product-container {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Windrose Section */
.windrose-section {
    flex: 1;
    padding: 1rem;
}

.windrose-image {
    width: 100%;
    max-width: 500px;
    height: auto;
}

.color-controls {
    margin-top: 1rem;
}

/* Details Section */
.details-section {
    flex: 1;
    padding: 1rem;
}

.station-name {
    color: #333; /* Example color */
    font-size: 2rem; /* Example font size */
    font-weight: bold; /* Example font weight */
    text-decoration: underline;
}


/* Form Elements */
.year-select {
    padding: 0.5rem;
    margin-bottom: 1rem;
    width: 200px;
}

button, select {
    
    text-transform: none;
}


.button-container {
    margin: 20px 0;

}

/* Payment Section */
#payment-container {
    margin-top: 2rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#payment-message {
    color: #dc3545;
    margin: 1rem 0;
}

/* Enhanced Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    align-items: center;
    text-align: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    text-align: center;
    width: 100%;
}

.modal-body {
    margin-bottom: 0.75rem;
    text-align: center;
}

.modal-body p {
    margin-bottom: 0.5rem;
    color: #555;
    line-height: 1.4;
}

.modal-body ul {
    display: inline-block;
    text-align: left;
    margin: 0 auto 0.75rem;
    padding-left: 1.5rem;
}

.modal-body li {
    margin-bottom: 0.25rem;
}

.modal-message-container {
    margin: 0.75rem 0;
    min-height: 25px;
    position: relative;
}

#download-button {
    display: block;
    width: 70%;
    margin: 0.75rem auto;
    padding: 0.6rem;
    font-size: 0.6rem;
}

.modal-footer {
    text-align: center;
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
}

#close-modal {
    width: 70%;
    margin: 0 auto;
    padding: 0.6rem;
}

.modal-close-btn {
    position: absolute;
    right: 1.25rem;
    top: 1.25rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: #333;
}

/* Improved Loading Spinner */
.spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(0,0,0,0.1);
    border-left-color: #28a745;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

#modal-spinner {
    display: block;
    margin: 0 auto 1rem;
}

.modal-message-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Don't hide the spinner in modal context */
#modal-spinner.active {
    display: block !important;
}

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

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Button Styles */
.btn {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

/* Specific styling for the button spinner only */
.spinner-button {
    width: 1rem !important; /* Smaller width, override the base class */
    height: 1rem !important; /* Smaller height, override the base class */
    border-width: 2px !important; /* Thinner border */
    margin: 0 !important; /* Remove all margins */
    vertical-align: middle; /* Better alignment with text */
}

/* Button styling to handle the spinner properly */
#submit-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    min-width: 120px;
}

.btn-primary {
    background-color: #4338CA;
    color: white;
    margin-top: 20px
}

.btn-secondary {
    background-color: #4338CA;
    color: white;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.error-message {
    color: #842029;
    background-color: #f8d7da;
    border: 1px solid #f5c2c7;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* Product Information */
.product-info {
    margin: 2rem 0;
}

.product-info h4 {
    margin-bottom: 1rem;
    color: #333;
}

.product-info span {
    display: block;
    margin-bottom: 0.5rem;
    color: #666;
}


.ownership-message {
    color: #0c5460;
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}


#download-button, 
#close-modal {
    display: block;
    width: 70%;
    margin: 0.75rem auto;
    padding: 0.6rem;
    font-size: 1rem; 
    text-align: center;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

#download-button {
    background-color: #28a745;
}

#download-button:hover {
    background-color: #218838;
}

#close-modal {
    background-color: #6c757d;
}

#close-modal:hover {
    background-color: #5a6268
}

/* Media Queries for Responsive Design */

/* Tablet and smaller devices */
@media screen and (max-width: 768px) {
    .product-container {
        flex-direction: column;
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .windrose-section, 
    .details-section {
        flex: none;
        width: 100%;
        padding: 0.75rem;
    }
    
    .windrose-image {
        width: 100%;
        max-width: 100%;
        min-height: 300px;
        object-fit: contain;
    }
    
    .station-name {
        font-size: 1.75rem;
    }
    
    .year-select {
        width: 100%;
        max-width: 300px;
    }
    
    /* Adjust modal for tablets */
    .modal-content {
        max-width: 450px;
    }
}

/* Mobile devices */
@media screen and (max-width: 480px) {
    .product-container {
        padding: 1rem;
        gap: 1rem;
    }
    
    .windrose-section, 
    .details-section {
        padding: 0.5rem;
    }
    
    .windrose-image {
        min-height: 250px;
    }
    
    .station-name {
        font-size: 1.5rem;
    }
    
    .btn, 
    .btn-primary, 
    .btn-secondary, 
    .btn-success {
        width: 100%;
        padding: 12px 16px;
        font-size: 1rem;
    }
    
    /* Form elements */
    .year-select {
        padding: 10px;
        font-size: 1rem;
    }
    
    /* Make payment container more compact */
    #payment-container {
        padding: 0.75rem;
        margin-top: 1.5rem;
    }
    
    /* Modal adjustments for very small screens */
    .modal-content {
        width: 95%;
        padding: 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    #download-button, 
    #close-modal {
        width: 100%;
        padding: 0.75rem;
    }
    
    /* Ensure error messages are readable */
    .error-message,
    .ownership-message {
        padding: 10px;
        font-size: 0.9rem;
    }
}