* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    background: #f5f5f5;
    width: 100%;
    height: 100vh;
    font-family: 'Roboto';
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
img {
    width: 100%;
    height: auto;
}
.content { 
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

header{
    /* height: 15%; */
    max-height: 100px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-content: center;
    padding:  25px;
    /* margin: 25px 0; */
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
    position: relative;
    z-index: 10;
}

header .left,header .right{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

header .left .logo{
    width: 100%;
    width: 155px;
    display: flex;
    align-items: center;
}
header .left .logo img{ 
    width: 100%;
}

.card-section {
    width: 100%;
    height: 100%;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 0;
    padding-top: 0;
    overflow: hidden;
}

/* Additional styles for CRUD operations - matching GoodUX design */
.crud-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.form-section {
    background: white;
    height: 100%;
    width: calc(100% - 600px);
    overflow-y: auto;
}


/* Right side edit form */
.form-section.edit {
    /* width: 100%; */
    width: 600px;
    background: #FBFBFB;
    padding: 40px 50px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Records list styles */
.records-list {
    display: flex;
    flex-direction: column;
    /* gap: 15px; */
}

.record-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px;
    gap: 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: all 0.3s ease;
}

.record-item:hover {
    background-color: #f8f9fa;
    border-color: #ddd;
}

.record-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #eee;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6px;
    text-align: center;
    text-wrap: wrap;
    color: #000;      
    flex-shrink: 0;
    overflow: hidden;
}

.record-details {
    display: flex;
    gap: 20px;
}
.record-avatar-container {
    display: flex;
    align-items: center;
    gap: 20px;
}
.record-name {
    font-family: 'Roboto';
    font-weight: bold;
    font-size: 20px;
    color: #2E2E2E;
}
.record-phone {
    word-break: break-all;   
    white-space: normal;     
    overflow-wrap: anywhere; 
}

.record-company {
    font-family: 'Roboto';
    font-size: 16px;
    color: #2E2E2E;
    opacity: 0.8;
    display: flex;
    align-items: center;
}
.record-actions{
    display: flex;
    align-items: center;
}

/* .record-actions img{
    width: 100%;
    height: 100%;
} */

.record-action-icon .edit-icon-container, .record-action-icon .delete-icon-container{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.no-records {
    text-align: center;
    padding: 20px;
    color: #999;
}


form#crud-form {
    display: flex;
    flex-direction: column;
    /* justify-content: center; */
    /* align-items: center; */
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* margin-bottom: 20px; */
}

.form-group:nth-child(4){
    padding-top: 40px;
    border-top: 1px solid #7070704D;
}

.form-group label {
    display: block;
    font-family: 'Roboto';
    font-size: 15px;
    /* color: #000000; */
    color: rgba(0, 0, 0, 0.6);
    /* margin-bottom: 8px; */
    padding-left: 15px;
}

.form-group input, 
.form-group textarea, 
.form-group select {
    width: 100%;
    padding: 15px;
    border: 1px solid #7070704D;
    border-radius: 10px;
    font-family: 'Roboto';
    font-size: 18px;
    /* font-weight: bold; */
    box-sizing: border-box;
}
.form-group input::placeholder, 
.form-group textarea::placeholder, 
.form-group select::placeholder {
    opacity: 0.2;
}

input[readonly] {
    background-color: #f0f0f0;
    /* border: 1px solid #ccc;    */
    /* color: #555;               */
    cursor: not-allowed;
}

input[readonly]:focus {
    outline: none;
    box-shadow: none;
}

/* Change focus border color to black */
.form-group input:focus, 
.form-group textarea:focus, 
.form-group select:focus {
    border-color: #000000;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}


.form-group textarea {
    min-height: 100px;
    resize: vertical;
}
.form-group .banner-image-container{
    position: relative;
}
.form-group .banner-img{
    position: relative;
    border-radius: 20px 20px 0 0 ;
    height: auto;
    width: 100%;
    /* max-width: 500px; */
    aspect-ratio: 500 / 160;
    overflow: hidden;
}
.form-group .banner-img .banner-img-edit, 
.form-group .banner-img img, 
.form-group .profile-img-container img {
    width: 100%;
}
/* .form-group .banner-img .banner-img-edit{ 
    position: absolute;
    height: 30px;
    width: 30px;
    right: 0px;
    bottom: 0px;
    background-color: rgba(255, 255, 255, 1);
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
} */
.form-group .banner-img-edit{
    display: flex;
    align-items: center;
    cursor: pointer;
}
.form-group .edit-button-container{ 
    display: flex;
    align-items: center;
    gap: 40px;
    margin:20px 20px 30px auto;
    width: max-content;
}

.form-group .profile-edit-container, .form-group .banner-edit-container { 
    display: flex;
    justify-content: center;
    align-items: center;
    color: #000000;
    font-family: 'Roboto';
    font-size: 14px;
    font-weight: bold;
}

.form-group .profile-img-container { 
    position: absolute;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    bottom: 15px;
    left: 20px;
    background-color: #f8f9fa; /* Added background for better visibility */
    border: 1px solid #dee2e6; /* Added border for better visibility */
    border-radius: 50%;
    overflow: hidden;
}
.form-group .profile-img-container .profile-img{ 
    width: 110px;
    height: 110px;
    border-radius: 110px;
    overflow: hidden;
}
/* .form-group .profile-img-container .profile-img-edit{ 
    position: absolute;
    width: 30px;
    height: 30px;
    background-color: rgba(255, 255, 255,0.8);
    border-radius: 50%;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
} */

.form-group .profile-img-edit{
    display: flex;
    align-items: center;
    cursor: pointer;
}

#profile-img-edit, #profile-img-edit label,
#banner-img-edit , #banner-img-edit label{
    cursor: pointer;
}

.btn{
    background: rgba(39, 22, 4, 0.05);
    border-radius: 10px;
    border: none;
    color: #271604;
    padding: 10px 15px;
    cursor: pointer;
    font-family: 'Roboto';
    font-size: 14px;
    font-weight: bold;
    transition: background 0.3s;
    width: auto;
    height: auto;
    text-align: center;
    justify-content: center;
    align-items: center;
    /* height: 40px; */
}

.btn:disabled{
    cursor: not-allowed;
    opacity: 0.5;
}

.btn:hover {
    background: #271604;
    color: white;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.currentRecords, .maxRecords{
    font-size: 14px;
    font-family: 'Roboto';
    font-weight: bold;
    color: #2E2E2E;
}
.cards-text{
    margin-left: 5px;
    font-family: 'Roboto';
    font-size: 14px;
    opacity: 0.6;
}

.Validity.success{
    background-color: green;
    padding: 10px 15px;
    border-radius: 20px;
    color: white;
}

.Validity.warning{
    background-color: red;
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
}


.add-btn{
    display: flex;
    align-items: center;
    gap: 10px;
}

.add-btn-container {
    width: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.add-btn:hover .add-btn-container svg {
    fill: white;
    stroke: white;
}


.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 10px;
    transition: background 0.3s;
}

.delete-btn:hover {
    background: #c82333;
}

.record-action-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    /* margin-left: 10px; */
    font-size: 16px;
    transition: color 0.3s;
    padding: 12px;
}

.edit-icon {
    color: #007bff;
}

.edit-icon:hover {
    color: #0056b3;
}

.delete-icon {
    color: #dc3545;
}

.delete-icon:hover {
    color: #c82333;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn{
    /* padding: 24px 18px; */
    font-size: 14px;
    display: flex;
    /* width: auto;
    height: auto; */
}

.btn-group .btn {
    width: auto;
    height: auto;
}



.section-title {
    font-family: 'Archivo';
    color: #2E2E2E;
    margin-bottom: 20px;
    font-size: 24px;
    text-align: center;
}

.notification {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-family: 'Roboto';
    width: auto;
    margin: 20px auto;
    position: absolute;
    /* left: 50%;
    top: 50%; */
    z-index: 9999;
}

.notification.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notification.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    position: absolute;
}

.hidden {
    display: none;
}

.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    display: block;
}

/* Cropper Styles */
.cropper-section {
    display: none;
    margin: 20px 0;
    flex-direction: column;
    align-items: center;
}

.cropper-container {
    max-width: 100%;
    margin: 20px 0;
}

#cropper-image {
    max-width: 100%;
    display: block;
}

.cropper-controls {
    text-align: center;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}
.cropper-aspect-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.aspect-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
}

.aspect-buttons .control-btn {
    background-color: #271604 ;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    min-width: 80px;
}

.aspect-buttons .control-btn.active {
    background-color: #271604;
}

.aspect-buttons .control-btn:hover {
    background-color: #271604;
}

.aspect-buttons .control-btn.active:hover {
    background-color: #271604;
}

.result-section {
    text-align: center;
    margin-top: 20px;
    display: none;
}

#cropped-result {
    max-width: 300px;
    border: 1px solid #ddd;
    margin: 10px auto;
    display: block;
}

.cropper-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}
.cropper-action-buttons{
    display: flex;
    justify-content: center;
    gap: 10px;
}

.control-btn {
    background-color: #271604;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin: 5px;
}

.control-btn:hover {
    background-color: #271604;
}

.download-link, .upload-link {
    background-color: #271604;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
    margin: 5px;
}

.download-link:hover, .upload-link:hover {
    background-color: #271604;
}

.logout-btn{
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}
.logout-btn i{
    display: flex;
    font-size: 20px;
}

.logout-btn i:hover {
    color: white;
}



@media (max-width: 1024px) { 
    body {
        overflow: scroll;
    }
    .crud-container{
        flex-direction: column;
        height: 100%;
        justify-content: unset;
    }
    .card-section {
        flex: auto;
    }
    .form-section {
        height: 50%;
    }
    
    .form-section:first-child,
    .form-section.edit {
        width: 100%;
        overflow: scroll;
        flex: 50%;
    }
    .form-section:first-child{
        max-height: 250px;
    }

    .form-section.edit {
        height: auto;
        padding: 40px 20px;
    }
    .record-name {
        font-size: 16px;
    }
    .record-phone{
        font-size: 14px;
    }
    .record-details {
        gap: 15px;
    }
    .record-avatar-container {
        gap: 15px;
    }
    .btn-group .btn {
        width: auto;
    }
    .notification {
        top: 45%;
    }
}

@media (max-width: 550px) {
    
    header .left .logo {
        width: 130px;
    }
    .form-section, .notification {
        width: auto;
        /* padding: 20px 15px; */
    }
    .record-name {
        font-size: 14px;
    }
    .record-phone{
        font-size: 12px;
    }
    .btn-group {
        flex-direction: column;
    }   
    .cropper-actions {
        flex-direction: column;
    }
    .record-details {
        gap: 15px;
    }
    .form-group label {
        font-size: 12px;
        padding-left: 10px;
    }
    .form-group input, .form-group textarea, .form-group select {
        font-size: 14px;
        padding: 10px;
    }
    .form-group {
        gap: 5px;
    }
    form#crud-form {
        gap: 10px;
    }
    .form-group:nth-child(4) {
        padding-top: 20px;
    }
}

@media (max-width: 450px) { 
    header .left .logo {
        width: 100px;
    }
    .btn {
        font-size: 8px;
        padding: 10px 10px;
        height: 30px;
    }
    header .left, header .right {
        gap: 10px;
    }
    header {
        padding: 15px;
    }
    .record-item {
        padding: 15px;
    }
    .record-avatar-container {
        gap: 10px;
    }
    .record-avatar {
        width: 35px;
        height: 35px;
    }
    /* .form-group .edit-button-container {
        justify-self: end;
        margin: auto 0;
    } */
    .form-group .profile-img-container {
        /* left: 0px; */
        bottom  : 20px;
    }
    .form-group .profile-img-container {
        width: 80px;
        height: 80px;
    }
    .form-group .profile-img-container .profile-img {
        width: 70px;
        height: 70px;
    }
    /* .form-group .edit-button-container {
        gap: 10px;
        width: 100%;
    } */
    .form-group .banner-img {
        margin-bottom: 10px;
    }
}


/* Cropper Modal Styles */
.cropper-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Increased opacity for better visibility */
}

.cropper-modal-content {
    background-color: #fff;
    margin: 2% auto;
    padding: 50px;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); /* Added shadow for better visibility */
}

.cropper-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.cropper-modal-header h2 {
    margin: 0;
    color: #333;
    font-family: 'Archivo';
}

.cropper-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.cropper-close:hover,
.cropper-close:focus {
    color: black;
    text-decoration: none;
}

.cropper-image-container {
    max-width: 100%;
    margin: 20px 0;
    text-align: center;
    background-color: #f8f9fa; /* Added background for better visibility */
    border: 1px solid #dee2e6; /* Added border for better visibility */
    border-radius: 5px;
    padding: 10px;
}

.cropper-image {
    max-width: 100%;
    max-height: 400px;
    opacity: 1; /* Ensure full opacity */
}

/* Ensure cropper.js elements are visible */
.cropper-container {
    direction: ltr;
    font-size: 0;
    line-height: 0;
    position: relative;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    opacity: 1; /* Ensure full opacity */
}

.cropper-container img {
    display: block;
    height: 100%;
    image-orientation: 0deg;
    max-height: none !important;
    max-width: none !important;
    min-height: 0 !important;
    min-width: 0 !important;
    width: 100%;
    opacity: 1; /* Ensure full opacity */
}

/* Additional cropper.js styles for better visibility */
.cropper-canvas,
.cropper-drag-box,
.cropper-crop-box,
.cropper-modal {
    opacity: 0.99 !important; /* Ensure full opacity */
}

.cropper-view-box {
    display: block;
    height: 100%;
    outline: 1px solid #271604;
    outline-color: rgba(39, 22, 4, 0.75);
    overflow: hidden;
    width: 100%;
    opacity: 1; /* Ensure full opacity */
}

.cropper-dashed {
    border: 0 dashed #eee;
    display: block;
    opacity: 0.5;
    position: absolute;
}

.cropper-dashed.dashed-h {
    border-bottom-width: 1px;
    border-top-width: 1px;
    height: calc(100% / 3);
    left: 0;
    top: calc(100% / 3);
    width: 100%;
}

.cropper-dashed.dashed-v {
    border-left-width: 1px;
    border-right-width: 1px;
    height: 100%;
    left: calc(100% / 3);
    top: 0;
    width: calc(100% / 3);
}
