/* main.css */
:root {
    --primary-color: #8e44ad;
    --primary-light: #9b59b6;
    --primary-dark: #6c3483;
    --secondary-color: #34495e;
    --background-color: #f3e5f5;
    --text-color: #2c3e50;
    --border-color: #d1c4e9;
    --box-shadow: 0 4px 6px rgba(142, 68, 173, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--background-color);
    color: var(--text-color);
    -webkit-border-radius: 20px;
}

.top-bar {
    background-color: var(--primary-color);
   
}
 /*padding: 0.5rem 1rem;*/
 /*   box-shadow: var(--box-shadow);*/
    /*bottom: 2;*/

/*.header {*/
/*    display: flex;*/
/*    align-items: center;*/
/*    justify-content: space-between;*/
/*    max-width: 1200px;*/
/*    margin: 0 auto;*/
/*}*/

/*.profile {*/
/*    display: flex;*/
/*    align-items: center;*/
/*    background-color: rgba(255, 255, 255, 0.1);*/
/*    padding: 0.5rem 1rem;*/
/*    border-radius: 50px;*/
/*    transition: all 0.3s ease;*/
/*}*/

/*.profile:hover {*/
/*    background-color: rgba(255, 255, 255, 0.2);*/
/*}*/

/*.profile-img {*/
/*    width: 40px;*/
/*    height: 40px;*/
/*    border-radius: 50%;*/
/*    margin-right: 0.75rem;*/
/*    border: 2px solid white;*/
/*    transition: all 0.3s ease;*/
/*}*/

/*.profile:hover .profile-img {*/
/*    transform: scale(1.1);*/
/*}*/

/*.profile-name {*/
/*    color: white;*/
/*    font-weight: bold;*/
/*    font-size: 0.9rem;*/
/*}*/

.header h2 {
    color: white;
    font-size: 1.8rem;
    letter-spacing: 1px;
}

.main-content {
    display: flex;
    flex: 1;
    padding: 1.5rem;
    gap: 1.5rem;
    margin-top: 30px;
}

.container {
    width: 250px;
    background-color: white;
    padding: 1.5rem;
    flex-shrink: 0;
    border-radius: 12px;
    box-shadow: var(--box-shadow);
}

.sidebar {
    flex: 1;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.box {
    margin-bottom: 1.2rem;
}

.btn {
    width: 100%;
    padding: 0.9rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(142, 68, 173, 0.2);
}

.edit{
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background-color: white;
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    position: relative;
}

.edit::before {
    content: attr(data-title);
    position: absolute;
    top: 0.7rem;
    left: 1.5rem;
    font-size: 0.9rem;
    color: var(--primary-color);
    opacity: 0.7;
    font-weight: bold;
    text-transform: uppercase;
}

.preview {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    /*background-color: #f0f0f0;*/
    border-radius: 12px;
    /*box-shadow: var(--box-shadow);*/
    position: relative;
    max-width: 375px;
    height: 667px;
    margin: 0 auto;
}

.preview::before {
    content: attr(data-title);
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    color: var(--primary-color);
    opacity: 0.7;
    font-weight: bold;
    text-transform: uppercase;
}

.preview::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 20px;
    background-color: #333;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.preview-content {
    width: 100%;
    height: 100%;
    border: 10px solid #333;
    border-radius: 30px;
    overflow-y: auto;
    background-color: white;
    position: relative;
    padding: 10px;
    
    /* Hide scrollbar while allowing scrolling */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/*.preview-content::before {*/
/*    content: '';*/
/*    position: absolute;*/
/*    bottom: 5px;*/
/*    left: 50%;*/
/*    transform: translateX(-50%);*/
/*    width: 40px;*/
/*    height: 40px;*/
/*    border: 2px solid #333;*/
/*    border-radius: 50%;*/
/*}*/


.mobile-taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--primary-color);
    display: none; /* Hidden by default on desktop */
    justify-content: space-around;
    padding: 10px 5px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.taskbar-button {
    background: none;
    border: none;
    color: white;
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.taskbar-button:active {
    background-color: var(--primary-light);
    transform: scale(0.95);
}

.taskbar-button i {
    font-size: 1.2rem;
}

/* Update Preview Content for Mobile */
.preview-content {
    width: 100%;
    height: calc(109% - 60px); /* Account for taskbar height */
    padding-bottom: 70px; /* Ensure content doesn't hide behind taskbar */
    overflow-y: auto;
}

/* Mobile view */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile {
        margin-bottom: 1rem;
    }

    .main-content {
        /*flex-direction: column;*/
        flex: 0.80;
    }

    .container {
        display: none; /* Hide original buttons */
    }
    
    .mobile-taskbar {
        display: flex;
    }

    .sidebar .btn {
        display: none; /* Hide original buttons */
    }

    .edit {
        order: 2;
        margin-bottom: 2.5rem;
    }
    
     .preview {
        display: none;
        position: fixed;
        top: 48%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 1000;
        width: 90%;
        height: 80vh;
        max-width: 375px;
        margin: 0;
        padding: 0;
        background-color: transparent;
        box-shadow: none;
    }

    .preview.show {
        display: block;
    }

    .preview-content {
        /*display: none;*/
        width: 100%;
        height: 100%;
        border: 10px solid #333;
        border-radius: 30px;
        overflow-y: auto;
        /*background-color: white;*/
        
    }

    .preview-content.show {
        display: block;
    }
    .buttons-group {
        padding-bottom: 80px; /* Ensure last items are visible above taskbar */
    }

    /*.mobile-only {*/
    /*    display: block;*/
    /*}*/

    /* Overlay styles */
    .overlay {
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }

    .overlay.show {
        display: block;
    }
}


/* iPhone SE and smaller devices */
@media (max-width: 375px) {
    .taskbar-button {
        width: 35px;
        height: 35px;
    }

    .taskbar-button i {
        font-size: 1rem;
    }

    .mobile-taskbar {
        padding: 8px 3px;
    }
}

/* Larger phones */
/*@media (min-width: 376px) and (max-width: 428px) {*/
/*    .preview-content {*/
/*        max-width: 100%;*/
/*    }*/
/*}*/

/* Tablets */
/*@media (min-width: 768px) and (max-width: 1024px) {*/
/*    .preview {*/
/*        max-width: 425px;*/
/*    }*/
/*}*/

/* Update button container for better mobile layout */
/*.button-container {*/
/*    width: calc(50% - 20px);*/
/*    margin: 10px;*/
/*}*/

/*@media (max-width: 480px) {*/
/*    .button-container {*/
/*        width: calc(100% - 20px);*/
/*    }*/
/*}*/

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    margin-top: 5px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="color"],
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 8px top 50%;
    background-size: 12px auto;
    padding-right: 24px;
}
#qrCodeContainer {
    text-align: center;
    margin-top: 20px;
}




/* Desktop view adjustments */
@media (min-width: 769px) {
    .preview {
        display: block;
    }

    .preview-content {
        display: block;
    }

    .mobile-only {
        display: none;
    }
}
/* Overlay for mobile popup */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.overlay.show {
    display: block;
}

.buttons-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
        padding: 10px 10px 10px 10px;
         margin-bottom: 30px;
}

.button-container {
  display: flex;
    flex-direction: column;
    align-items: center;
    width: 50%;
    padding: 10px;
    /*box-sizing: border-box;*/
    transition: all 0.3s ease;
}


.button-image {
    width: 100px;
    height: 100px;
   
}


.button-container .first-in-row {
    width: 100%; /* One button per row on smaller screens */
}

.button-container :hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(0, 0, 0, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

.button-container :active {
    transform: translateY(1px);
    box-shadow: 0 3px 4px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.08);
}


/* ... (previous styles remain unchanged) */

.qr-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.qr-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    text-align: center;
    min-width: 350px;
    max-width: 90%;
}

.qr-popup .btn {
    margin: 15px 5px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    background-color: #007bff;
    color: white;
    transition: background-color 0.2s;
}

.qr-popup .btn:hover {
    background-color: #0056b3;
}

.qr-popup .btn.close-btn {
    background-color: #6c757d;
}

.qr-popup .btn.close-btn:hover {
    background-color: #545b62;
}


.added-item {
    display: flex;
    align-items: center;
    background-color: #f0f0f0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.added-item:hover {
    background-color: #e0e0e0;
}

.added-item span {
    flex-grow: 1;
    margin-right: 10px;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

.edit-btn, .delete-btn {
    border: none;
    background-color: transparent;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.edit-btn {
    color: #4CAF50;
}

.edit-btn:hover {
    background-color: rgba(76, 175, 80, 0.1);
}

.delete-btn {
    color: #F44336;
}

.delete-btn:hover {
    background-color: rgba(244, 67, 54, 0.1);
}

.btn-icon {
    font-size: 1.2rem;
}


.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f0f2f5;
}

.auth-form {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 300px;
}

.error-messages {
    color: red;
    margin-bottom: 15px;
}

.success-message {
    color: green;
    margin-bottom: 15px;
}


/* Validation Styles */
.invalid {
    border: 2px solid red !important;
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@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);
    }
}