@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap');

* {
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: calc(100% - 32px);
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f0ff 50%, #f0f4ff 100%);
    color: #333333;
    min-height: 100vh;
    line-height: 1.6;
    padding-bottom: 64px;
    overscroll-behavior: none;
}

.container {
    padding: 0px;
    max-width: 1200px;
    margin: 0 auto;
}

a {
    color: #2ECBFF;
}

h1 {
    text-align: left;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #333333 0%, #2ECBFF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    text-align: left;
    font-size: 1rem;
    color: rgba(51, 51, 51, 0.7);
    margin-bottom: 32px;
}

button {
    padding: 18px 32px;
    background: linear-gradient(135deg, #76E0FF 0%, #2ECBFF 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 16px;
}

.type-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.type-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: 2px solid rgba(46, 203, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: #333333;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    gap: 8px;
}

.type-btn:hover {
    border-color: #2ECBFF;
    background: rgba(46, 203, 255, 0.1);
}

.type-btn.selected {
    background: linear-gradient(135deg, #76E0FF 0%, #2ECBFF 100%);
    color: #ffffff;
    border-color: #2ECBFF;
}

.type-btn i {
    font-size: 1.1rem;
}

.sections {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    margin-bottom: 32px;
}

.section {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(46, 203, 255, 0.1);
}

.section h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section h2::before {
    content: '1';
    background: #2ECBFF;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
}

.section:nth-child(2) h2::before {
    content: '2';
}

.content-input {
    display: none;
}

.content-input.active {
    display: block;
}

.placeholder-qr {
    width: 100%;
    height: 300px;
    border-radius: 12px;
    background: rgba(248, 249, 255, 0.8);
    border: 1px solid rgba(46, 203, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-qr svg {
    width: 200px;
    height: 200px;
}

.color-pickers {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.color-picker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.color-picker label {
    font-size: 0.9rem;
    color: #333333;
    font-weight: 500;
}

.picker-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-picker input[type="color"] {
    width: 50px;
    height: 50px;
    border: solid 2px #000000;
    margin-bottom: 8px;
    border-radius: 0px;
    cursor: pointer;
    padding: 0;
}

.hex-input {
    width: 80px;
    padding: 8px;
    border: 1px solid rgba(51, 51, 51, 0.2);
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
}

form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

label {
    font-weight: 600;
    font-size: 0.95rem;
    color: rgba(51, 51, 51, 0.9);
    margin-bottom: 8px;
    display: block;
}

input, select, textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid rgba(51, 51, 51, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: #333333;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #2ECBFF;
    box-shadow: 0 0 0 3px rgba(46, 203, 255, 0.1);
}

input::placeholder, textarea::placeholder {
    color: rgba(51, 51, 51, 0.5);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23333333' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 48px;
}

button[type="submit"] {
    padding: 18px 32px;
    background: linear-gradient(135deg, #76FF8B 0%, #2ECBFF 100%);
    color: #133C4A;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700 !important;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 16px;
    align-self: flex-start;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(46, 203, 255, 0.3);
}

.field-group {
    display: none;
    animation: fadeIn 0.3s ease;
}

.field-group.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.preview-section {
    background: rgba(248, 249, 255, 0.8);
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
    border: 1px solid rgba(46, 203, 255, 0.1);
}

.preview-section strong {
    color: #2ECBFF;
}

.preview-section textarea, .preview-section span {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(51, 51, 51, 0.1);
    border-radius: 6px;
    padding: 12px;
    font-family: monospace;
    font-size: 0.85rem;
    color: #333333;
    width: 100%;
    resize: vertical;
    display: block;
    margin-top: 8px;
}

.error {
    color: #ff6b6b;
    font-size: 0.9rem;
    margin-top: 4px;
    display: none;
}

#header {
    margin-bottom: 24px;
}

#branding {
    float: left;
    width: 30%;
    margin-top: 8px;
    text-align: left !important;
}

#user {
    float: right;
}

#user button {
    margin: 0;
    padding: 8px 14px !important;
    background: linear-gradient(135deg, #a8a8ff 0%, #6b6bff 100%);
    color: #ffffff;
}

.clear {
    clear: both;
}

button {
}

.activeUserBeta {
    width: auto;
    border-radius: 24px;
    background: #ffffff !important;
    box-sizing: border-box;
    padding: 8px;
    position: relative;
    cursor: pointer;
}

.userIcon {
    width: 24px !important;
    height: 24px !important;
    float: left;
    margin-right: 8px;
}

.userIcon i {
    font-size: 24px;
}

.userName {
    min-width: 100px;
    width: auto;
    padding-right: 8px;
    float: left;
}

.userName i {
    margin-left: 8px;
}

.userDropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
}

.userDropdown.active {
    display: block;
}

.userDropdown a {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.userDropdown a:last-child {
    border-bottom: none;
}

.userDropdown a:hover {
    background: #f8f9fa;
}

.userDropdown a i {
    margin-right: 8px;
    width: 20px;
    text-align: center;
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    right: -300px;
    background: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 10001;
    max-width: 300px;
    word-wrap: break-word;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.modal-content button {
    margin: 0 10px;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.modal-content button:first-child {
    background: #e74c3c;
    color: white;
}

.modal-content button:last-child {
    background: #95a5a6;
    color: white;
}

/* Dashboard Styles */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.qr-count {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
}

/* Buttons */
.create-btn, .analysis-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #2ECBFF, #1ca7d9);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.create-btn:hover, .analysis-btn:hover {
    background: linear-gradient(135deg, #1ca7d9, #0f8bc3);
    transform: translateY(-1px);
}

/* Analysis Styles */
.analysis-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.analysis-filters label {
    font-weight: 500;
    color: #212529;
}

.analysis-filters select, .analysis-filters input {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-box {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.stat-box:hover {
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2ECBFF;
    margin: 8px 0;
}

.stat-label {
    color: #6c757d;
    font-size: 0.875rem;
}

/* Chart Container */
.chart-container {
    width: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 20px;
    overflow: hidden;
}

#scans-chart {
    max-height: 400px;
    width: 100% !important;
}

/* Professional QR Grid - Grid Layout Always */
.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

/* Professional QR Card Design */
.qr-card {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
}

.qr-card:hover {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.status-circle {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    z-index: 1;
    box-shadow: 0 0 0 2px white;
}

.status-circle.status-active {
    background: #28a745;
    animation: pulse 2s infinite;
}

.status-circle.status-deactivated {
    background: #dc3545;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    70% { box-shadow: 0 0 0 12px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.qr-image {
    padding: 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    flex-shrink: 0;
}

.qr-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.qr-details {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.type-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #6c757d;
}

.type-icon i {
    color: #2ECBFF;
    font-size: 1rem;
}

.qr-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
    line-height: 1.3;
}

.updated-date {
    font-size: 0.75rem;
    color: #adb5bd;
    margin: 0;
}

/* Professional Action Buttons - Softer Pastel Colors */
.quick-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.action-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    color: white;
}

.edit-btn {
    background: linear-gradient(135deg, #A7C7E7, #B3D9FF);
}

.edit-btn:hover {
    background: linear-gradient(135deg, #9AB8D9, #A6CFF7);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(167, 199, 231, 0.3);
}

.copy-btn {
    background: linear-gradient(135deg, #B2D8B2, #C8E6C9);
}

.copy-btn:hover {
    background: linear-gradient(135deg, #A5D6A5, #BCE3B0);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(178, 216, 178, 0.3);
}

.toggle-btn {
    background: linear-gradient(135deg, #FFF9C4, #FFF59D);
    color: #333333;
    font-weight: 600;
}

.toggle-btn.status-active {
    background: linear-gradient(135deg, #C8E6C9, #B2D8B2);
    color: #2E7D32;
}

.toggle-btn.status-deactivated {
    background: linear-gradient(135deg, #FFCDD2, #EF9A9A);
    color: #C62828;
}

.toggle-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 249, 196, 0.3);
}

.delete-btn {
    background: linear-gradient(135deg, #E0E0E0, #BDBDBD);
    color: #424242;
}

.delete-btn:hover {
    background: linear-gradient(135deg, #D0D0D0, #ADADAD);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(224, 224, 224, 0.3);
}

/* Stats Row */
.stats-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.scans-btn, .download-btn {
    flex: 1;
    padding: 10px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    font-size: 0.875rem;
    color: #495057;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 500;
}

.scans-btn:hover, .download-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
    color: #212529;
}

/* Short Link Container */
.short-link-container {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 24px;
    padding: 8px 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.short-link-container:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.short-link {
    flex: 1;
    font-size: 0.75rem;
    color: #6c757d;
    word-break: break-all;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.short-link-copy {
    background: #2ECBFF;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: background 0.2s;
    flex-shrink: 0;
}

.short-link-copy:hover {
    background: #1ca7d9;
}

/* Filter Controls */
.filter-controls {
    background: white;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    width: auto !important;
    margin: 0 !important;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.filter-btn:hover {
    border-color: #667eea;
}

.accountBtn {
    width: auto !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sections {
        display: flex;
        flex-direction: column-reverse;
        gap: 32px;
    }
   
    .type-buttons {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
    }
   
    body {
        padding: 16px;
    }
   
    .container {
        padding: 0px;
        border-radius: 16px;
    }
   
    h1 {
        font-size: 2rem;
    }
   
    .section {
        padding: 20px;
    }
   
    .color-pickers {
        flex-direction: column;
        align-items: center;
    }
   
    .picker-row {
        flex-direction: column;
        gap: 4px;
    }
   
    .hex-input {
        width: 100%;
        max-width: 120px;
    }
   
    .quick-actions {
        flex-wrap: wrap;
        gap: 4px;
    }
   
    .action-btn {
        flex: 1 1 48%;
        padding: 10px;
        font-size: 0.8rem;
    }
   
    .stats-row {
        flex-direction: column;
    }
   
    .stats-grid {
        grid-template-columns: 1fr;
    }
   
    .qr-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
   
    .dashboard-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
   
    .analysis-filters {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }
   
    .type-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
   
    .qr-card {
        border-radius: 12px;
    }
   
    .qr-image {
        padding: 16px;
    }
   
    .qr-details {
        padding: 16px;
    }
}

@media (max-width: 360px) {
    h1 {
        font-size: 1.5rem;
    }
   
    .container {
        padding: 0px;
    }
}