/**
 * Selwyn Frontend Styles
 *
 * @package Selwyn
 */

/* Container styles */
.selwyn-account,
.selwyn-instances,
.selwyn-create-instance {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Notices */
.selwyn-notices {
    margin-bottom: 20px;
}

.selwyn-notice {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.selwyn-notice-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.selwyn-notice-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.selwyn-notice-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.selwyn-notice-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Status badges */
.selwyn-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-transform: capitalize;
}

.selwyn-status-active {
    background-color: #d1fae5;
    color: #065f46;
}

.selwyn-status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.selwyn-status-pending_deletion {
    background-color: #fee2e2;
    color: #991b1b;
}

.selwyn-status-deleted {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* Headers */
.selwyn-account-header,
.selwyn-instances-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.selwyn-account-header h2,
.selwyn-instances-header h2 {
    margin: 0;
    font-size: 24px;
    color: #111827;
}

/* Account details */
.selwyn-account-details {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.selwyn-detail-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.selwyn-detail-row:last-child {
    border-bottom: none;
}

.selwyn-label {
    flex: 0 0 150px;
    font-weight: 600;
    color: #374151;
}

.selwyn-value {
    flex: 1;
    color: #111827;
}

.selwyn-billing-status {
    color: #059669;
    font-weight: 500;
}

/* Buttons */
.selwyn-button {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.selwyn-button-primary {
    background-color: #2563eb;
    color: #fff;
}

.selwyn-button-primary:hover {
    background-color: #1d4ed8;
    color: #fff;
}

.selwyn-button-secondary {
    background-color: #e5e7eb;
    color: #374151;
}

.selwyn-button-secondary:hover {
    background-color: #d1d5db;
    color: #374151;
}

.selwyn-button-danger {
    background-color: #dc2626;
    color: #fff;
}

.selwyn-button-danger:hover {
    background-color: #b91c1c;
    color: #fff;
}

.selwyn-button-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Account actions */
.selwyn-account-actions {
    margin-bottom: 20px;
}

/* Deletion form */
.selwyn-deletion-form {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.selwyn-deletion-form h3 {
    margin: 0 0 15px 0;
    color: #991b1b;
}

.selwyn-warning {
    background: #fee2e2;
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 15px;
    color: #7f1d1d;
}

.selwyn-pending-deletion {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.selwyn-pending-deletion p {
    margin: 0 0 15px 0;
    color: #92400e;
}

/* Form fields */
.selwyn-form {
    max-width: 600px;
}

.selwyn-form-field {
    margin-bottom: 20px;
}

.selwyn-form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.selwyn-form-field label .required {
    color: #dc2626;
}

.selwyn-form-field input[type="text"],
.selwyn-form-field textarea,
.selwyn-form-field select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.selwyn-form-field input[type="text"]:focus,
.selwyn-form-field textarea:focus,
.selwyn-form-field select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.selwyn-form-field textarea {
    resize: vertical;
    min-height: 80px;
}

.selwyn-field-description {
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
}

/* Type options */
.selwyn-type-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.selwyn-type-option {
    display: block;
    cursor: pointer;
}

.selwyn-type-option input[type="radio"] {
    display: none;
}

.selwyn-type-card {
    display: block;
    padding: 20px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.selwyn-type-option input[type="radio"]:checked + .selwyn-type-card {
    border-color: #2563eb;
    background: #eff6ff;
}

.selwyn-type-name {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 5px;
}

.selwyn-type-price {
    display: block;
    font-size: 14px;
    color: #059669;
    font-weight: 500;
    margin-bottom: 10px;
}

.selwyn-type-description {
    display: block;
    font-size: 13px;
    color: #6b7280;
}

/* Feature options */
.selwyn-feature-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.selwyn-feature-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.selwyn-feature-option:hover {
    background: #f3f4f6;
}

.selwyn-feature-option input[type="checkbox"] {
    margin-right: 12px;
}

.selwyn-feature-label {
    flex: 1;
    font-weight: 500;
    color: #374151;
}

.selwyn-feature-price {
    font-size: 13px;
    color: #059669;
}

/* Form summary */
.selwyn-form-summary {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.selwyn-form-summary h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #111827;
}

.selwyn-summary-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.selwyn-summary-total {
    display: flex;
    justify-content: space-between;
    padding: 12px 0 0 0;
    font-weight: 600;
    font-size: 16px;
}

.selwyn-summary-price {
    color: #059669;
}

/* Form actions */
.selwyn-form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Instances list */
.selwyn-instances-list {
    display: grid;
    gap: 20px;
}

.selwyn-instance-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.2s ease;
}

.selwyn-instance-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.selwyn-instance-card.selwyn-status-pending_deletion {
    border-color: #fca5a5;
    background: #fef2f2;
}

.selwyn-instance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.selwyn-instance-header h3 {
    margin: 0;
    font-size: 18px;
    color: #111827;
}

.selwyn-instance-details {
    margin-bottom: 15px;
}

.selwyn-instance-type {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 10px;
}

.selwyn-instance-features {
    margin-bottom: 10px;
}

.selwyn-feature {
    display: inline-block;
    padding: 3px 8px;
    background-color: #e0e7ff;
    color: #3730a3;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 5px;
    margin-bottom: 5px;
}

.selwyn-instance-price {
    font-size: 14px;
    color: #059669;
    font-weight: 500;
}

.selwyn-instance-credentials {
    margin-top: 15px;
    padding: 15px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.selwyn-instance-credentials h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.selwyn-credential-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.selwyn-credential-row:last-child {
    margin-bottom: 0;
}

.selwyn-credential-row .selwyn-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.selwyn-credential-row .selwyn-value {
    font-size: 13px;
    color: #111827;
    font-family: 'Courier New', monospace;
    background-color: #ffffff;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    word-break: break-all;
}

.selwyn-instance-actions {
    margin-bottom: 10px;
}

.selwyn-instance-deletion-form {
    margin-top: 10px;
    padding: 15px;
    background: #fef2f2;
    border-radius: 6px;
}

.selwyn-instance-meta {
    font-size: 12px;
    color: #9ca3af;
}

/* Inline form */
.selwyn-inline-form {
    display: inline;
}

/* Empty state */
.selwyn-empty {
    text-align: center;
    padding: 40px;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
}

.selwyn-empty p {
    margin: 0 0 20px 0;
    color: #6b7280;
}

/* Login required */
.selwyn-login-required {
    text-align: center;
    padding: 40px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.selwyn-login-required p {
    margin: 0 0 20px 0;
    color: #374151;
}

/* Error message */
.selwyn-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 20px;
    color: #991b1b;
}

.selwyn-message {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 20px;
    color: #374151;
}

/* Registration form */
.selwyn-register,
.selwyn-already-registered {
    max-width: 480px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.selwyn-register h2 {
    margin: 0 0 10px;
    font-size: 28px;
    color: #111827;
    text-align: center;
}

.selwyn-register-intro {
    text-align: center;
    color: #6b7280;
    margin-bottom: 30px;
}

.selwyn-register-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.selwyn-errors {
    background-color: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.selwyn-errors .selwyn-error {
    color: #991b1b;
    margin: 0 0 5px;
}

.selwyn-errors .selwyn-error:last-child {
    margin-bottom: 0;
}

.selwyn-form-row-half {
    display: flex;
    gap: 15px;
}

.selwyn-form-col {
    flex: 1;
}

.selwyn-field-hint {
    font-size: 13px;
    color: #6b7280;
    margin: 5px 0 0;
}

.selwyn-login-link {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
}

.selwyn-login-link a {
    color: #2563eb;
    text-decoration: none;
}

.selwyn-login-link a:hover {
    text-decoration: underline;
}

.selwyn-button-large {
    padding: 14px 28px;
    font-size: 16px;
    width: 100%;
}

.selwyn-already-registered {
    text-align: center;
    padding: 40px;
    background: #f9fafb;
    border-radius: 8px;
}

.selwyn-already-registered p {
    margin: 0 0 20px;
    color: #374151;
}

/* Login required - update to include register button */
.selwyn-login-required {
    text-align: center;
    padding: 40px;
    background: #f9fafb;
    border-radius: 8px;
}

.selwyn-login-required p {
    margin: 0 0 15px;
    color: #374151;
}

.selwyn-login-required .selwyn-button {
    margin: 0 5px;
}

/* Responsive */
@media screen and (max-width: 600px) {
    .selwyn-account-header,
    .selwyn-instances-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .selwyn-detail-row {
        flex-direction: column;
    }

    .selwyn-label {
        flex: none;
        margin-bottom: 5px;
    }

    .selwyn-type-options {
        grid-template-columns: 1fr;
    }

    .selwyn-instance-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .selwyn-form-actions {
        flex-direction: column;
    }

    .selwyn-form-actions .selwyn-button {
        width: 100%;
        text-align: center;
    }

    .selwyn-form-row-half {
        flex-direction: column;
        gap: 0;
    }

    .selwyn-register-form {
        padding: 20px;
    }

    .selwyn-login-required .selwyn-button {
        display: block;
        margin: 10px auto;
    }
}
