/* Styling for toggle switches */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #F9004D;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Inline image layout */
.image-grid-container {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    margin: 30px auto;
    width: 100%;
}

.image-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.image-grid-container img {
    max-width: 120px;
    max-height: 120px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 10px;
}

.image-grid-container input[type="file"] {
    width: auto;
    text-align: center;
    font-size: 14px;
}

/* General container styles for light background */
.switch-wrapper {
    display: grid;
    grid-template-columns: 150px 1fr 60px;
    align-items: center;
    gap: 15px;
    background: #ffffff;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Labels */
.switch-wrapper label:not(.switch) {
    color: #333;
    font-size: 14px;
    font-weight: 500;
    text-align: right;
}

/* Input Fields */
.input-field {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.input-field:focus {
    border-color: #F9004D;
    box-shadow: 0 0 0 2px rgba(249, 0, 77, 0.1);
    outline: none;
}

/* Primary Button */
.primary-button {
    width: 300px;
    margin: 30px auto;
    background-color: #F9004D;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    text-align: center;
    justify-self: center;
}

.primary-button:hover {
    background-color: #cc003a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .switch-wrapper {
        grid-template-columns: 120px minmax(300px, 1fr) 60px;
    }
}

@media screen and (max-width: 480px) {
    #create-card-form {
        max-width: 95%;
    }
    
    .switch-wrapper {
        grid-template-columns: 100px minmax(200px, 1fr) 50px;
    }
}

/* Accordion Styles */
.accordion {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.accordion-button {
    position: relative;
    width: 60% !important;
    margin: 20px auto !important;
    text-align: center;
    overflow: visible;
}

.accordion-button:hover {
    background-color: #cc003a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.accordion-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.accordion-button::after {
    content: '▼';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    transition: transform 0.3s ease;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.accordion-button.active::after {
    transform: translateY(-50%) rotate(180deg);
}

.accordion-content {
    width: 95%;
    margin: 0 auto 20px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
}

.image-preview-container {
    width: 100%;
    max-width: 300px;
    height: 300px; /* Ensure square container */
    overflow: hidden;
    margin: 10px auto;
    border: 1px solid #ccc;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-preview-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.crop-btn {
    display: inline-block;
    padding: 8px 15px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

.crop-btn:hover {
    background-color: #45a049;
}

/* Notification Container */
.notification-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    pointer-events: none;
}

.notification {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 25px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    text-align: center;
    animation: slideIn 0.3s ease-out;
}

.notification.fade-out {
    animation: fadeOut 0.3s ease-in forwards;
}

.notification.success {
    background: rgba(76, 175, 80, 0.9);
}

.notification.error {
    background: rgba(244, 67, 54, 0.9);
}

@keyframes slideIn {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

/* Form Container */
#create-card-form {
    display: grid;
    grid-template-columns: 1fr;
    width: 1000px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
}

/* Input field disabled state */
.input-field:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    border-color: #ddd;
}

/* Switch wrapper with disabled input */
.switch-wrapper .input-field:disabled {
    opacity: 0.6;
}

/* Ensure consistent spacing when field is disabled */
.switch-wrapper .input-field:disabled + .switch {
    opacity: 1;
}

/* Validation States */
.input-field.valid {
    background-color: #e8f5e9;
    border-color: #4caf50;
}

.input-field.invalid {
    background-color: #ffebee;
    border-color: #f44336;
}

.verify-btn {
    padding: 5px 15px;
    background-color: #F9004D;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
}

.verify-btn.verified {
    background-color: #4caf50;
}

/* Color picker styling */
input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    padding: 0;
    width: 50px;
    height: 50px;
    margin-right: 10px;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.invalid-label {
    color: #f44336;
    animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}


.image-preview-container.invalid {
    animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
    border: 2px solid #f44336;
    border-radius: 4px;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Color picker container */
.color-picker-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 15px auto;
    width: 100%;
}

.color-picker-container .form-field {
    display: flex;
    align-items: center;
    gap: 10px;
    width: auto;
}

.color-picker-container label {
    min-width: 120px;
    text-align: right;
}

/* Keep existing color picker styles */
.color-picker-container input[type="color"] {
    width: 50px;
    height: 50px;
    min-width: 50px;
    padding: 0;
}

/* Responsive adjustments */
@media screen and (max-width: 840px) {
    #create-card-form {
        width: 95%;
    }
}

.vcf-preview-btn {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background-color: #e0e0e0;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #666;
    padding: 0;
    font-size: 20px;
    line-height: 1;
}

.vcf-preview-btn:hover {
    background-color: #45a049;
    color: white;
    transform: translateY(1px);
}

.vcf-preview-btn.active {
    background-color: #4CAF50;
    color: white;
}

.image-preview-container.required-image {
    border: 2px solid #ff0000;
}

.image-preview-container:not(.required-image) {
    border: 2px solid #ccc;
}