/**
 * Order Page Styles - Enhanced Version
 * Modern design for assignment/exam order form
 */

/* Order Page Wrapper */
.order-page-wrapper {
    padding: 6rem 0 3rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.order-page-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

.order-page-wrapper::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(118, 75, 162, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 15s infinite ease-in-out reverse;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(30px, 30px) scale(1.1);
    }
}

.order-page-wrapper .container {
    max-width: 1200px;
    position: relative;
    z-index: 1;
}

/* Sidebar Card */
.order-sidebar {
    margin-bottom: 2rem;
}

.sidebar-card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 120px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sidebar-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
}

.sidebar-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.sidebar-card h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-feature {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: default;
    border: 2px solid transparent;
}

.sidebar-feature:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateX(8px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.sidebar-feature i {
    font-size: 1.8rem;
    color: #667eea;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.sidebar-feature:hover i {
    color: #667eea;
    transform: scale(1.1) rotate(5deg);
}

.sidebar-feature span {
    font-size: 0.95rem;
    font-weight: 600;
    flex: 1;
}

/* Order Form Card */
.order-form-section {
    margin-bottom: 2rem;
}

.order-form-card {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: box-shadow 0.3s ease;
}

.order-form-card:hover {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
}

/* Offer Badge */
.offer-badge {
    position: absolute;
    top: -15px;
    right: 30px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
    animation: pulse 2s infinite, shimmer 3s infinite;
    z-index: 10;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
}

@keyframes shimmer {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
    }
    50% {
        box-shadow: 0 8px 35px rgba(255, 107, 107, 0.6);
    }
}

/* Form Title */
.form-title {
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    text-align: center;
    line-height: 1.3;
}

.form-subtitle {
    font-size: 1.15rem;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
}

/* Coupon Success */
.coupon-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    color: #155724;
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 600;
    animation: slideDown 0.5s ease;
}

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

/* Form Styling */
.order-form {
    margin-top: 2rem;
}

.order-form .form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem 1.5rem;
}

.order-form .form-group {
    padding: 0 0.5rem;
    margin-bottom: 0.5rem;
}

.order-form label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-form label .required {
    color: #dc3545;
    margin-left: 3px;
}

.order-form .form-control {
    width: 100%;
    padding: 1rem 1rem 1rem 3.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
    font-family: inherit;
}

.order-form .form-control:hover {
    border-color: #c0c0c0;
}

.order-form .form-control:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.order-form textarea.form-control {
    resize: vertical;
    min-height: 140px;
    padding: 1rem;
    line-height: 1.6;
}

/* Input with Icon */
.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 1.2rem;
    z-index: 2;
    transition: all 0.3s ease;
}

.input-with-icon .form-control:focus + i,
.input-with-icon:hover i {
    color: #764ba2;
    transform: translateY(-50%) scale(1.1);
}

.input-with-icon select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%23667eea' d='M7 10L2 5h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.25rem center;
    background-size: 14px;
    padding-right: 3rem;
    cursor: pointer;
}

/* Page Counter Group */
.page-counter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 0.75rem;
}

.page-counter-btn {
    width: 48px;
    height: 48px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    font-weight: 700;
    user-select: none;
}

.page-counter-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.page-counter-btn:active {
    transform: scale(0.95);
}

.page-display-group {
    flex: 1;
    text-align: center;
    background: white;
    border-radius: 10px;
    padding: 0.5rem;
    border: 2px solid #e0e0e0;
}

.page-display-group input {
    width: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-weight: 700;
    font-size: 1.25rem;
    padding: 0.5rem;
    color: #2c3e50;
}

.page-display-group input:focus {
    outline: none;
}

.word-count-display {
    display: block;
    font-size: 0.9rem;
    color: #667eea;
    margin-top: 0.25rem;
    font-weight: 600;
}

/* File Upload Section */
.file-upload-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-file-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 3px dashed #c0c0c0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    font-size: 1rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.btn-file-upload::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.btn-file-upload:hover::before {
    left: 100%;
}

.btn-file-upload:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f3ff 0%, #e8ebff 100%);
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
}

.btn-file-upload i {
    font-size: 1.5rem;
}

.file-message {
    font-size: 0.9rem;
    color: #999;
    font-style: italic;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.file-message.has-files {
    color: #28a745;
    font-weight: 600;
    background: #d4edda;
}

/* Submit Button */
.btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.25rem 3.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 250px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-submit:hover::before {
    width: 300px;
    height: 300px;
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.btn-submit:active {
    transform: translateY(-1px);
}

/* Hide if customize */
.hide-if-customize {
    display: none !important;
}

/* Form Validation States */
.form-control.is-invalid {
    border-color: #dc3545;
    background: #fff5f5;
    animation: shake 0.5s;
}

.form-control.is-valid {
    border-color: #28a745;
    background: #f0fff4;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-weight: 600;
    padding: 0.5rem;
    background: #fff5f5;
    border-radius: 6px;
    border-left: 3px solid #dc3545;
    animation: slideDown 0.3s ease;
}

.valid-feedback {
    display: block;
    color: #28a745;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-weight: 600;
    padding: 0.5rem;
    background: #f0fff4;
    border-radius: 6px;
    border-left: 3px solid #28a745;
    animation: slideDown 0.3s ease;
}

/* Loading State */
.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.btn-submit.loading {
    pointer-events: none;
}

.btn-submit.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 3px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    margin-left: 0.75rem;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

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

/* Success/Error Messages */
.form-message {
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-align: center;
    animation: slideDown 0.5s ease;
}

.form-message.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    color: #155724;
}

.form-message.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 2px solid #dc3545;
    color: #721c24;
}

/* Responsive Design */
@media (max-width: 991px) {
    .order-page-wrapper {
        padding: 5rem 0 2rem;
    }
    
    .sidebar-card {
        position: static;
        margin-bottom: 2rem;
    }
    
    .order-form-card {
        padding: 2.5rem;
    }
    
    .form-title {
        font-size: 1.75rem;
    }
    
    .form-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 767px) {
    .order-page-wrapper {
        padding: 4rem 0 2rem;
    }
    
    .order-form-card {
        padding: 2rem 1.5rem;
    }
    
    .sidebar-card {
        padding: 2rem 1.5rem;
    }
    
    .form-title {
        font-size: 1.5rem;
    }
    
    .form-subtitle {
        font-size: 0.95rem;
    }
    
    .offer-badge {
        position: static;
        display: inline-block;
        margin-bottom: 1rem;
        font-size: 1rem;
        padding: 0.6rem 1.5rem;
    }
    
    .order-form .form-group {
        padding: 0;
        margin-bottom: 1rem;
    }
    
    .order-form .form-row {
        margin: 0 0 1rem;
    }
    
    .sidebar-feature {
        font-size: 0.9rem;
        padding: 0.875rem;
    }
    
    .sidebar-feature i {
        font-size: 1.5rem;
        width: 35px;
        height: 35px;
    }
    
    .btn-submit {
        width: 100%;
        padding: 1.125rem;
        font-size: 1.1rem;
        min-width: auto;
    }
    
    .page-counter-btn {
        width: 42px;
        height: 42px;
        font-size: 1.5rem;
    }
}

/* Grid System */
@media (min-width: 768px) {
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (min-width: 992px) {
    .col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    .col-lg-8 {
        flex: 0 0 66.666667%;
        max-width: 66.666667%;
    }
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

.text-center {
    text-align: center;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

[class*="col-"] {
    padding: 0 15px;
}

/* Tooltip */
.tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    font-size: 12px;
    font-weight: 700;
    cursor: help;
    margin-left: 5px;
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 100;
    transition: all 0.3s ease;
}

.tooltip-wrapper:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}
