/**
 * LearnPress Course Codes - Frontend Styles
 */

/* Form Wrapper */
.lp-course-codes-form-wrapper {
    max-width: 600px;
    margin: 30px auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e8ecef;
}

/* Header Section */
.lp-course-codes-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f3f4;
    color: #333 !important;
}

.lp-form-description {
    color: #666;
    font-size: 16px;
    margin: 10px 0 0 0;
    line-height: 1.5;
}

/* Login Notice */
.lp-course-codes-login-notice {
    max-width: 500px;
    margin: 30px auto;
    padding: 40px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.lp-course-codes-login-notice .notice-content {
    max-width: 400px;
    margin: 0 auto;
}

.lp-course-codes-login-notice .notice-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 20px;
    opacity: 0.9;
}

.lp-course-codes-login-notice h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 600;
}

.lp-course-codes-login-notice p {
    margin: 0 0 25px 0;
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.5;
}

.notice-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.notice-actions .button {
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.notice-actions .button-primary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.notice-actions .button-primary:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-2px);
}

.notice-actions .button-secondary {
    background: transparent;
    color: white;
}

.notice-actions .button-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-2px);
}

.lp-course-codes-form-wrapper h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333 !important;
    font-size: 28px;
}

.form-group {
    margin-bottom: 25px;
}

/* Label Styling */
.form-group label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.label-text {
    flex: 1;
}

.label-required {
    color: #dc3545;
    font-weight: bold;
    margin-left: 5px;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    margin-bottom: 8px;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 16px 50px 16px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #fafbfc;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
    background: #fff;
}

.input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    opacity: 0.6;
    pointer-events: none;
}

.input-help {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

/* Submit Button */
.lp-submit-btn {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    padding: 16px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.lp-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.lp-submit-btn:hover::before {
    left: 100%;
}

.lp-submit-btn:hover {
    background: linear-gradient(135deg, #005a87 0%, #004d72 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 115, 170, 0.3);
    text-decoration: none;
    color: white;
}

.lp-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.lp-submit-btn:disabled::before {
    display: none;
}

.btn-icon {
    transition: transform 0.3s ease;
}

.lp-submit-btn:hover .btn-icon {
    transform: translateX(5px);
}

/* Messages */
.lp-message {
    padding: 16px;
    margin-bottom: 25px;
    border-radius: 8px;
    font-weight: 500;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInDown 0.4s ease-out;
}

.lp-message-icon::before {
    font-size: 20px;
}

.lp-message-success {
    background-color: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.lp-message-success .lp-message-icon::before {
    content: "✅";
}

.lp-message-error {
    background-color: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

.lp-message-error .lp-message-icon::before {
    content: "❌";
}

.lp-message-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left-color: #ffc107;
}

.lp-message-warning .lp-message-icon::before {
    content: "⚠️";
}

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

/* Loading State */
.lp-course-codes-loading {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-top: 15px;
}

.lp-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* User's Activated Courses */
.lp-my-codes {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #e1e5e9;
}

.lp-my-codes h3 {
    margin-bottom: 25px;
    color: #333;
    font-size: 24px;
}

.activated-course {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.activated-course:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.activated-course .course-info {
    flex: 1;
    margin-right: 20px;
}

.activated-course .course-info h4 {
    margin: 0 0 10px 0;
    color: #333 !important;
    font-size: 18px;
    font-weight: 600;
}

.activated-course .course-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.activated-course .course-info .code-info {
    background: #0073aa;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    margin-top: 5px;
}

.activated-course .course-action .button {
    background: #28a745;
    color: white !important;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
    display: inline-block;
}

.activated-course .course-action .button:hover {
    background: #218838;
    text-decoration: none;
    color: white !important;
}

/* Empty State */
.lp-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.lp-empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .lp-course-codes-form-wrapper {
        margin: 20px;
        padding: 20px;
    }

    .activated-course {
        flex-direction: column;
        text-align: center;
    }

    .activated-course .course-info {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .activated-course .course-action {
        width: 100%;
    }

    .activated-course .course-action .button {
        width: 100%;
        padding: 15px;
    }
}

/* Success Animation */
.lp-success-animation {
    animation: fadeInUp 0.5s ease-out;
}

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

/* Code Input Styling */
.form-group input[type="text"].code-input {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    text-align: center;
}

/* Additional Utility Classes */
.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}