/* CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Variables */
:root {
    /* Colors */
    --primary-color: #0D8ABC;
    --secondary-color: #175D8C;
    --text-color: #333333;
    --background-color: #f5f5f5;
    --card-color: #ffffff;
    --accent-color: #26a4db;
    --error-color: #e53935;
    --success-color: #43a047;
    
    /* Other variables */
    --card-radius: 16px;
    --button-radius: 8px;
    --shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --container-width: 360px;
}

/* Dark Mode */
.dark-mode {
    --primary-color: #26a4db;
    --secondary-color: #0D8ABC;
    --text-color: #f5f5f5;
    --background-color: #1a1a1a;
    --card-color: #292929;
    --accent-color: #39bff1;
    --shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Typography */
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: var(--transition);
}

/* Layout */
.container {
    width: 100%;
    max-width: var(--container-width);
    position: relative;
}

/* Dark Mode Toggle */


.mode-toggle input {
    display: none;
}

.mode-toggle label {
    width: 50px;
    height: 25px;
    background-color: var(--secondary-color);
    display: block;
    border-radius: 50px;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.mode-toggle label::after {
    content: "";
    position: absolute;
    width: 19px;
    height: 19px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: var(--transition);
}

.mode-toggle input:checked + label {
    background-color: var(--accent-color);
}

.mode-toggle input:checked + label::after {
    transform: translateX(25px);
}

/* Card */
.card {
    position: relative;
    width: 100%;
    height: 550px;
    perspective: 1500px;
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: var(--card-radius);
    padding: 20px;
    background-color: var(--card-color);
    box-shadow: var(--shadow);
    backface-visibility: hidden;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card-back {
    transform: rotateY(180deg);
}

.card.flipped .card-front {
    transform: rotateY(180deg);
}

.card.flipped .card-back {
    transform: rotateY(0);
}

/* Header */
.header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-text {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1.5px;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.tab-button {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    opacity: 0.7;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.tab-button:hover {
    opacity: 1;
}

.tab-button.active {
    color: var(--primary-color);
    opacity: 1;
    font-weight: 600;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
}

.tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.tab-pane {
    display: none;
    height: 100%;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Profile */
.profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
}

.profile-picture {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
}

.profile-picture img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.status-indicator {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    background-color: var(--success-color);
    border-radius: 50%;
    border: 2px solid var(--card-color);
}

.profile-details h1 {
    color: var(--text-color);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.profile-details p {
    color: var(--text-color);
    opacity: 0.8;
}

.profile-details #profile-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
}

.profile-details #profile-bio {
    font-size: 14px;
    max-width: 90%;
    margin: 0 auto;
}

/* Contact Links */
.contact-links {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.contact-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-color);
    width: 30%;
    padding: 12px;
    border-radius: var(--button-radius);
    background-color: rgba(0, 0, 0, 0.03);
    transition: var(--transition);
}

.dark-mode .contact-button {
    background-color: rgba(255, 255, 255, 0.05);
}

.contact-button:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.contact-button i {
    font-size: 20px;
    margin-bottom: 5px;
}

.contact-button span {
    font-size: 12px;
    font-weight: 500;
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: auto;
    margin-bottom: 20px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.03);
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.dark-mode .social-icon {
    background-color: rgba(255, 255, 255, 0.05);
}

.social-icon:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    opacity: 0.8;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--button-radius);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    background-color: transparent;
    color: var(--text-color);
    transition: var(--transition);
}

.dark-mode .form-group input,
.dark-mode .form-group textarea {
    border-color: rgba(255, 255, 255, 0.1);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    min-height: 100px;
    resize: none;
}

/* Buttons */
.submit-button, 
.download-button,
.save-button,
.cancel-button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--button-radius);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-button,
.save-button,
.download-button {
    background-color: var(--primary-color);
    color: white;
}

.submit-button:hover,
.save-button:hover,
.download-button:hover {
    background-color: var(--accent-color);
}

.cancel-button {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

.dark-mode .cancel-button {
    background-color: rgba(255, 255, 255, 0.05);
}

.cancel-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.dark-mode .cancel-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Form Status */
#form-status {
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
}

.success-message {
    color: var(--success-color);
    padding: 10px;
    border-radius: var(--button-radius);
    background-color: rgba(67, 160, 71, 0.1);
}

.error-message {
    color: var(--error-color);
    padding: 10px;
    border-radius: var(--button-radius);
    background-color: rgba(229, 57, 53, 0.1);
}

/* QR Code */
.qrcode-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    height: 100%;
}

#qrcode {
    width: 180px;
    height: 180px;
    padding: 10px;
    border-radius: var(--button-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.qrcode-container p {
    font-size: 14px;
    text-align: center;
    color: var(--text-color);
    opacity: 0.8;
}

/* vCard */
.vcard-preview {
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: var(--button-radius);
    padding: 15px;
    margin-bottom: 20px;
}

.dark-mode .vcard-preview {
    background-color: rgba(255, 255, 255, 0.02);
}

.vcard-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.dark-mode .vcard-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.vcard-header i {
    font-size: 18px;
    color: var(--primary-color);
}

.vcard-header span {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.vcard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.vcard-item:last-child {
    margin-bottom: 0;
}

.vcard-item i {
    width: 20px;
    font-size: 16px;
    color: var(--primary-color);
}

.vcard-item span {
    font-size: 14px;
    color: var(--text-color);
}

/* Flip Indicator */
.flip-indicator {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.dark-mode .flip-indicator {
    background-color: rgba(255, 255, 255, 0.05);
}

.flip-indicator:hover {
    background-color: var(--primary-color);
    color: white;
}


/* Edit Modal */
.edit-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.edit-overlay.active {
    opacity: 1;
    visibility: visible;
}

.edit-modal {
    width: 90%;
    max-width: 400px;
    background-color: var(--card-color);
    border-radius: var(--card-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    max-height: 90vh;
    overflow-y: auto;
}

.edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.edit-header h2 {
    color: var(--primary-color);
    font-size: 20px;
    font-weight: 600;
}

.close-button {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition);
}

.close-button:hover {
    opacity: 1;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-actions button {
    flex: 1;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: var(--button-radius);
    box-shadow: var(--shadow);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
}

.toast.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -10px);
}

/* Responsive Design */
@media (max-width: 400px) {
    .profile-picture {
        width: 100px;
        height: 100px;
    }
    
    .profile-details h1 {
        font-size: 22px;
    }
    
    .tab-button {
        font-size: 13px;
        padding: 8px;
    }
    
    .contact-button i {
        font-size: 18px;
    }
    
    .contact-button span {
        font-size: 11px;
    }
    
    .social-icon {
        width: 36px;
        height: 36px;
    }
}