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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    min-height: 100vh;
    background: #0f0f23;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 119, 198, 0.3) 0%, transparent 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: all 0.3s ease;
}

body[dir="rtl"] {
    direction: rtl;
}

.container {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 480px;
    transform: translateY(20px);
    opacity: 0;
    animation: slideUp 0.8s ease-out forwards;
    position: relative;
    color: #ffffff;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.language-selector {
    display: flex;
    gap: 10px;
}

body[dir="rtl"] .language-selector {
    right: auto;
    left: 20px;
}

.lang-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s ease;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
}

.lang-btn:hover, .lang-btn.active {
    border-color: #25D366;
    background: rgba(37, 211, 102, 0.1);
    color: #25D366;
    transform: translateY(-1px);
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.messenger-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    gap: 4px;
}

.messenger-btn {
    padding: 10px 8px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    font-size: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
}

.messenger-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.messenger-btn:hover:not(.active) {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.05);
}

.messenger-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
}

.app-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

h1 {
    color: #ffffff;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.025em;
}

.subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    margin-bottom: 32px;
    font-weight: 400;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 0.875rem;
}

input, textarea, select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    transition: all 0.2s ease;
    outline: none;
    font-family: inherit;
}

input:focus, textarea:focus, select:focus {
    border-color: #25D366;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

input::placeholder, textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

select option {
    background: #1a1a2e;
    color: #ffffff;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.phone-input-group {
    display: flex;
    gap: 12px;
}

.country-select {
    flex: 0 0 140px;
}

.phone-input {
    flex: 1;
    position: relative;
}

.phone-prefix {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    pointer-events: none;
    z-index: 1;
}

body[dir="rtl"] .phone-prefix {
    left: auto;
    right: 16px;
}

.phone-input input {
    padding-left: 60px;
}

body[dir="rtl"] .phone-input input {
    padding-left: 16px;
    padding-right: 60px;
}

.btn-container {
    text-align: center;
    margin-top: 35px;
}

.btn-go {
    background: #25D366;
    color: white;
    border: none;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-go.telegram { background: #0088cc; }
.btn-go.signal { background: #3A76F0; }
.btn-go.viber { background: #665CAC; }
.btn-go.messenger { background: #006AFF; }

.btn-go:hover {
    background: #20b858;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-go.telegram:hover {
    background: #007bb5;
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
}

.btn-go.signal:hover {
    background: #2c5fdb;
    box-shadow: 0 4px 12px rgba(58, 118, 240, 0.3);
}

.btn-go.viber:hover {
    background: #54508a;
    box-shadow: 0 4px 12px rgba(102, 92, 172, 0.3);
}

.btn-go.messenger:hover {
    background: #0056cc;
    box-shadow: 0 4px 12px rgba(0, 106, 255, 0.3);
}

.btn-go:active {
    transform: translateY(0);
}

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

.result {
    margin-top: 24px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(37, 211, 102, 0.2);
    display: none;
}

.result.telegram { border-color: rgba(0, 136, 204, 0.2); }
.result.signal { border-color: rgba(58, 118, 240, 0.2); }
.result.viber { border-color: rgba(102, 92, 172, 0.2); }
.result.messenger { border-color: rgba(0, 106, 255, 0.2); }

.result.show {
    display: block;
    animation: fadeInUp 0.4s ease-out;
}

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

.result h3 {
    color: #25D366;
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 500;
}

.result.telegram h3 { color: #0088cc; }
.result.signal h3 { color: #3A76F0; }
.result.viber h3 { color: #665CAC; }
.result.messenger h3 { color: #006AFF; }

.result-tabs {
    display: flex;
    margin-bottom: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 2px;
}

.tab-btn {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.url-container, .qr-container {
    display: none;
}

.url-container.active, .qr-container.active {
    display: block;
}

.qr-container {
    text-align: center;
    padding: 20px;
}

.qr-code {
    background: white;
    padding: 16px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 12px;
}

.url-display {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 6px;
    word-break: break-all;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 12px;
}

.btn-copy, .btn-open {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s ease;
}

body[dir="rtl"] .btn-copy, body[dir="rtl"] .btn-open {
    margin-right: 0;
    margin-left: 8px;
}

.btn-open {
    background: #25D366;
    border-color: #25D366;
    color: white;
}

.btn-open.telegram { background: #0088cc; border-color: #0088cc; }
.btn-open.signal { background: #3A76F0; border-color: #3A76F0; }
.btn-open.viber { background: #665CAC; border-color: #665CAC; }
.btn-open.messenger { background: #006AFF; border-color: #006AFF; }

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.btn-open:hover {
    background: #20b858;
    transform: translateY(-1px);
}

.btn-open.telegram:hover { background: #007bb5; }
.btn-open.signal:hover { background: #2c5fdb; }
.btn-open.viber:hover { background: #54508a; }
.btn-open.messenger:hover { background: #0056cc; }



.error-message {
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid rgba(255, 82, 82, 0.3);
    color: #ff5252;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.error-message.show {
    display: block;
}

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

.success-message {
    background: rgba(37, 211, 102, 0.1);
    border: 1px solid rgba(37, 211, 102, 0.3);
    color: #25D366;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.success-message.show {
    display: block;
}

@media (max-width: 600px) {
    .container {
        margin: 10px;
        padding: 30px 20px;
    }
    
    h1 {
        font-size: 1.5em;
    }

    .phone-input-group {
        flex-direction: column;
    }

    .country-select {
        flex: 1;
    }

    .language-selector {
        position: relative;
        top: auto;
        right: auto;
        left: auto;
        justify-content: center;
        margin-bottom: 20px;
    }

    .header {
        margin-top: 20px;
    }

    .messenger-selector {
        grid-template-columns: repeat(2, 1fr);
    }
}

.hidden {
    display: none;
}
/* Custom Select Dropdown */
.custom-select-wrapper {
    position: relative;
}

.custom-select {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    transition: all 0.2s ease;
    outline: none;
    font-family: inherit;
}

.custom-select.open {
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    position: relative;
}

.custom-select-trigger .selected-flag {
    width: 24px;
    height: 18px;
    margin-right: 12px;
    border-radius: 3px;
}

body[dir="rtl"] .custom-select-trigger .selected-flag {
    margin-right: 0;
    margin-left: 12px;
}

.custom-select-trigger .arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #fff;
    margin-left: auto;
    transition: transform 0.2s ease;
}

body[dir="rtl"] .custom-select-trigger .arrow {
    margin-left: 0;
    margin-right: auto;
}

.custom-select.open .arrow {
    transform: rotate(180deg);
}

.custom-options {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 10;
}

.custom-select.open .custom-options {
    display: block;
}

.custom-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.custom-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.custom-option img {
    width: 24px;
    height: 18px;
    margin-right: 12px;
    border-radius: 3px;
}

body[dir="rtl"] .custom-option img {
    margin-right: 0;
    margin-left: 12px;
}

/* Scrollbar styling for custom dropdown */
.custom-options::-webkit-scrollbar {
    width: 8px;
}

.custom-options::-webkit-scrollbar-track {
    background: transparent;
}

.custom-options::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.custom-options::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

footer {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

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

.logo-icon {
    width: 64px;
    height: 64px;
    mix-blend-mode: screen;
}
