/* Base styling */
body {
    background-color: rgb(255, 255, 255);
    color: black;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    padding-bottom: 60px;
    font-family: Arial, sans-serif;
}

/* Header styling */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header h1 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    color: #666;
}

.logout-button {
    padding: 8px 15px;
    background-color: #dc3545;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s;
}

.logout-button:hover {
    background-color: #c82333;
}

/* Logo positioning */
.logo {
    position: fixed;
    bottom: 10px;
    right: 10px;
    max-width: min(300px, 25vw);
    max-height: min(300px, 25vh);
    z-index: 0;
    opacity: 0.8;
}

/* Content Wrapper */
.content-wrapper {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    margin: 40px auto;
    max-width: 1200px;
    padding: 20px;
    align-items: flex-start;
    position: relative;
    z-index: 1;
}

/* Sections */
.section {
    background-color: #ffffff;
    color: black;
    box-sizing: border-box;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.section:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Specific section styles */
.left-section {
    flex: 1.2;
    min-width: 380px;
}

.middle-section {
    flex: 1;
    min-width: 320px;
}

.right-section {
    flex: 0.8;
    min-width: 280px;
}

/* Form styles */
#ordxForm {
    background-color: rgb(255, 255, 255);
    color: black;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    width: 100%;
}

/* Fieldset styling */
fieldset {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    margin-top: 0;
}

/* Remove border from top-level fieldsets */
#ordxForm > fieldset,
.left-section > fieldset,
.middle-section > fieldset,
.right-section > fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

/* Nested fieldsets styling */
#ordxForm fieldset fieldset,
.left-section fieldset fieldset,
.middle-section fieldset,
.right-section fieldset {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    background-color: #ffffff;
}

/* Form field alignment */
fieldset label {
    display: inline-block;
    width: 120px;
    vertical-align: middle;
    margin-right: 10px;
    font-size: 14px;
    color: #444;
}

/* Input and select styling */
#ordxForm input[type="text"], 
#ordxForm select,
.section input[type="text"], 
.section select {
    display: inline-block;
    width: calc(100% - 135px);
    min-width: 150px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 8px;
    vertical-align: middle;
    box-sizing: border-box;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Fieldset legend styling */
legend {
    font-weight: bold;
    margin-bottom: 10px;
    padding: 0 10px;
    color: #333;
    font-size: 16px;
}

/* Button section styling */
.button-section {
    width: 100%;
    text-align: center;
    position: fixed;
    bottom: 20px;
    left: 0;
    background: rgba(255,255,255,0.9);
    padding: 10px 0;
    z-index: 2;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

#generateButton {
    font-size: 1.5em;
    padding: 15px 30px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

#generateButton:hover {
    background-color: #45a049;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

#generateButton:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Field validation styling */
.field-error {
    border-color: #dc3545 !important;
    background-color: #fff8f8;
}

.error-feedback {
    color: #dc3545;
    font-size: 0.875em;
    margin-top: -5px;
    margin-bottom: 10px;
    padding-left: 130px;
}

/* Message container styling */
#message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.message {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease-out;
    font-size: 14px;
}

.message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Media query for smaller screens */
@media (max-width: 1200px) {
    .content-wrapper {
        flex-direction: column;
        margin: 20px;
    }

    #ordxForm {
        flex-direction: column;
    }

    .section {
        margin-bottom: 15px;
        min-width: unset;
    }

    #ordxForm fieldset fieldset,
    .left-section fieldset fieldset,
    .middle-section fieldset,
    .right-section fieldset {
        padding: 10px;
    }

    .logo {
        display: none;
    }

    fieldset label {
        width: 100%;
        margin-bottom: 5px;
    }

    #ordxForm input[type="text"], 
    #ordxForm select,
    .section input[type="text"], 
    .section select {
        width: 100%;
    }

    .error-feedback {
        padding-left: 0;
    }
}

/* Login page specific styling */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f8f9fa;
}

.login-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    max-width: 200px;
    margin-bottom: 20px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #444;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.login-button {
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
}

.login-button:hover {
    background-color: #45a049;
}

.error-message {
    color: #dc3545;
    margin-bottom: 15px;
    font-size: 14px;
}