/* Shared styles aligned with Appleid_Hub */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.auth-container,
.main-container,
.admin-container {
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
}

#auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: fixed;
    inset: 0;
    z-index: 100;
}

.auth-warning {
    position: fixed;
    top: 1rem;
    left: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 101;
    display: none;
    animation: slideInLeft 0.3s ease-out;
}

.auth-warning.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.auth-warning.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.auth-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-box h1 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.auth-box h2 {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.admin-login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.admin-auth-box {
    max-width: 420px;
}

.admin-auth-actions {
    margin-top: 1rem;
}

.admin-auth-actions .btn {
    width: 100%;
}

.form-container {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
}

#source-extra-config {
    font-family: Consolas, "SFMono-Regular", Monaco, monospace;
    min-height: 140px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-group label {
    margin: 0;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.duration-options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.duration-option {
    flex: 1;
    min-width: 120px;
    cursor: pointer;
    position: relative;
}

.duration-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.duration-option span {
    display: block;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s;
    background: white;
    color: #555;
}

.duration-option input[type="radio"]:checked + span {
    background: #667eea;
    color: white;
    border-color: #667eea;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.duration-option:hover span {
    border-color: #667eea;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.3);
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.btn-warning {
    background-color: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background-color: #e0a800;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
    color: transparent !important;
}

.btn-loading::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: inherit;
    animation: pulse 1.5s ease-in-out infinite;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-top: -9px;
    margin-left: -9px;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.security-alert {
    background: #fff3cd;
    color: #856404;
    padding: 1rem;
    text-align: center;
    font-weight: 700;
}

.header {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    font-size: 1.5rem;
    color: #667eea;
}

.header-right {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.main-content {
    padding: 2rem;
    max-width: 1280px;
    margin: 0 auto;
}

.groups-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.announcement-panel,
.info-notice {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.announcement-content,
.info-notice {
    font-size: 1rem;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.info-notice p {
    margin: 0.35rem 0;
}

.info-notice p:first-child {
    margin-top: 0;
}

.info-notice p:last-child {
    margin-bottom: 0;
}

.group-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.group-header {
    padding: 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.group-title {
    font-size: 1.25rem;
    color: #333;
    margin: 0;
}

.group-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.group-status {
    color: #666;
    font-size: 0.875rem;
}

.group-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.group-content.expanded {
    max-height: none;
    transition: max-height 0.5s ease-in;
}

.group-search {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.search-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
}

.accounts-container {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
    gap: 1.25rem;
}

.account-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.2s;
    min-width: 0;
}

.account-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.account-username {
    flex: 1;
    min-width: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-region {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.account-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-item {
    display: grid;
    grid-template-columns: 5.4rem minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
    font-size: 1rem;
    line-height: 1.45;
}

.info-label {
    color: #666;
    font-weight: 600;
    flex-shrink: 0;
    text-align: left;
    white-space: nowrap;
}

.info-value {
    color: #333;
    font-weight: 500;
    text-align: right;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-item-note .info-value {
    white-space: nowrap;
}

.account-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.account-actions .btn {
    min-width: 0;
    font-size: 0.95rem;
    white-space: nowrap;
}

.tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: white;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab,
.tab-btn {
    background: none;
    border: none;
    width: 100%;
    padding: 0.8rem 0.75rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
    white-space: nowrap;
    text-align: center;
}

.tab:hover,
.tab-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.tab.active,
.tab-btn.active {
    background: #667eea;
    color: white;
}

.tab-content {
    display: none;
}

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

.section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.section h2 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.25rem;
}

.section-header {
    margin-bottom: 1rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.data-table,
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.data-table th,
.data-table td,
table th,
table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.data-table th,
table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tbody tr:hover,
table tbody tr:hover {
    background: #f8f9fa;
}

.data-table tbody tr:last-child td,
table tbody tr:last-child td {
    border-bottom: none;
}

.url-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.actions .btn {
    white-space: nowrap;
    flex: 0 0 auto;
}

.form-help {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #666;
    white-space: pre-wrap;
}

.config-preview {
    margin-top: 0.5rem;
    padding: 0.75rem;
    max-height: 140px;
    overflow: auto;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.75rem;
    font-family: Consolas, "SFMono-Regular", Monaco, monospace;
}

.parser-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.parser-name {
    flex: 0 0 auto;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.config-preview-inline {
    flex: 1;
    min-width: 0;
    display: inline-block;
    padding: 0.35rem 0.55rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    color: #555;
    font-size: 0.78rem;
    font-family: Consolas, "SFMono-Regular", Monaco, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status-badge.active,
.status-valid {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive,
.status-invalid {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.pending,
.status-unused {
    background: #e3f2fd;
    color: #1565c0;
}

.status-badge.expired,
.status-expired {
    background: #fff3cd;
    color: #856404;
}

.result-message {
    margin-top: 1rem;
}

.generated-codes-panel {
    background: #e8f5e9;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 1rem;
}

.generated-codes-panel h3 {
    margin-bottom: 1rem;
    color: #2e7d32;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
    margin-top: 1rem;
    display: none;
}

.message {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 4px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    display: none;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
}

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

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

.message.show {
    display: block;
}

.no-data {
    text-align: center;
    color: #666;
    padding: 2rem;
    grid-column: 1 / -1;
}

.card-loader {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    height: 240px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.card-loader::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    animation: shimmer 1.5s infinite;
}

.loader-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.loader-username {
    width: 60%;
    height: 1.5rem;
    background: #e9ecef;
    border-radius: 4px;
}

.loader-region {
    width: 30%;
    height: 1.5rem;
    background: #e9ecef;
    border-radius: 12px;
}

.loader-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.loader-item {
    display: flex;
    gap: 1rem;
}

.loader-label {
    width: 25%;
    height: 1rem;
    background: #e9ecef;
    border-radius: 4px;
}

.loader-value {
    width: 75%;
    height: 1rem;
    background: #e9ecef;
    border-radius: 4px;
}

.loader-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: auto;
}

.loader-btn {
    width: 45%;
    height: 2.5rem;
    background: #e9ecef;
    border-radius: 4px;
}

.error-data {
    text-align: center;
    color: #dc3545;
}

.codes-list {
    list-style: none;
    padding: 1rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.codes-list li {
    background: white;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
    font-family: "Courier New", monospace;
    font-weight: 600;
    text-align: center;
}

.note {
    font-style: italic;
    margin-top: 1rem;
    font-size: 0.875rem;
    opacity: 0.8;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

.toast.info {
    background: #17a2b8;
}

.toast.warning {
    background: #ffc107;
    color: #333;
}

.copy-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 2rem;
    border-radius: 4px;
    font-weight: 500;
    z-index: 1000;
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.fetch-progress {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    color: #666;
    font-size: 0.875rem;
}

.fetch-errors {
    padding: 1rem 1.5rem;
    background: #f8d7da;
    border-top: 1px solid #f5c6cb;
    color: #721c24;
}

.errors-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.errors-list {
    list-style: none;
    padding-left: 1rem;
}

.errors-list li {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.confirm-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

.confirm-modal.is-hidden {
    display: none;
}

.confirm-modal-content {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
}

.confirm-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.confirm-modal-message {
    margin-bottom: 2rem;
    line-height: 1.5;
    color: #666;
}

.confirm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.confirm-modal-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-modal-btn.cancel {
    background: #6c757d;
    color: white;
}

.confirm-modal-btn.confirm {
    background: #667eea;
    color: white;
}

.code-view-modal-content {
    position: relative;
    max-width: 520px;
    width: min(92vw, 520px);
    padding-top: 2.5rem;
}

.code-view-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    border: none;
    background: transparent;
    color: #666;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

.code-view-tip {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.code-view-value {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    text-align: center;
    letter-spacing: 0.08em;
    word-break: break-all;
}

.code-view-meta {
    margin-top: 0.75rem;
    color: #666;
    font-size: 0.9rem;
}

.code-view-actions {
    margin-top: 1.5rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

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

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

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

@keyframes pulse {
    0%,
    100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.7;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .main-content {
        padding: 0.75rem;
    }

    .group-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .group-controls {
        justify-content: center;
    }

    .accounts-container {
        grid-template-columns: 1fr;
        padding: 0;
        gap: 0.75rem;
    }

    .account-card {
        padding: 1.1rem 1rem 1.2rem;
        margin: 0;
        max-width: 100%;
    }

    .info-item {
        grid-template-columns: 5rem minmax(0, 1fr);
        gap: 0.625rem;
        font-size: 1.02rem;
    }

    .form-row {
        flex-direction: column;
    }

    .header-right {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .header-right .btn {
        width: 100%;
    }

    .data-table,
    table {
        font-size: 0.875rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table th,
    .data-table td,
    table th,
    table td {
        padding: 0.5rem;
        white-space: nowrap;
    }

    .url-cell {
        max-width: 150px;
    }

    .parser-cell {
        gap: 0.5rem;
    }

    .parser-name {
        font-size: 0.82rem;
    }

    .config-preview-inline {
        font-size: 0.72rem;
        padding: 0.3rem 0.45rem;
    }

    .section {
        padding: 1rem;
    }

    .form-actions,
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions .btn,
    .section-header .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 0.5rem;
    }

    .group-header {
        padding: 1rem;
    }

    .auth-box {
        margin: 1rem;
        padding: 1.5rem;
    }

    .toast,
    .message {
        right: 1rem;
        left: 1rem;
        top: 1rem;
        max-width: none;
    }

    .copy-toast {
        width: calc(100% - 2rem);
        max-width: 320px;
        text-align: center;
    }

    .account-actions .btn {
        width: 100%;
    }

    .info-item {
        grid-template-columns: 4.85rem minmax(0, 1fr);
        gap: 0.5rem;
        font-size: 1rem;
    }

    .account-username {
        font-size: 1.22rem;
    }

    .account-region {
        font-size: 0.8rem;
    }

    .tabs {
        gap: 0.35rem;
        padding: 0.35rem;
    }

    .tab,
    .tab-btn {
        padding: 0.7rem 0.4rem;
        font-size: 0.92rem;
    }

    .code-view-modal-content {
        width: calc(100% - 1.5rem);
        padding: 2.25rem 1rem 1rem;
    }

    .code-view-value {
        font-size: 1.05rem;
    }

    .duration-option {
        min-width: calc(50% - 0.375rem);
    }
}
