* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Times New Roman', Times, serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    direction: rtl;
    text-align: right;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100%;
}

h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 30px;
    margin: 0;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

h1 i {
    margin-left: 15px;
    font-size: 1.2em;
}

.site-description {
    text-align: center;
    padding: 10px 30px 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.site-description p {
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    line-height: 1.4;
}

.site-description i {
    color: #ffd700;
    margin-left: 8px;
    font-size: 1.1em;
}

.telegram-link {
    text-align: center;
    padding: 0 30px 20px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.telegram-btn {
    display: inline-block;
    background: #0088cc;
    color: white;
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
}

.telegram-btn:hover {
    background: #0077b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
    text-decoration: none;
    color: white;
}

.telegram-btn i {
    margin-left: 8px;
    font-size: 1.1em;
    color: white;
}

.tiktok-btn {
    display: inline-block;
    background: #000000;
    color: white;
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.tiktok-btn:hover {
    background: #ff0050;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 80, 0.4);
    text-decoration: none;
    color: white;
}

.tiktok-btn i {
    margin-left: 8px;
    font-size: 1.1em;
    color: white;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
    font-size: 1.5em;
}

h2 i {
    color: #667eea;
    margin-left: 10px;
}

h3 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.2em;
}

h3 i {
    color: #667eea;
    margin-left: 8px;
}

.form-section {
    padding: 30px;
    border-bottom: 1px solid #eee;
}

.input-group {
    margin-bottom: 20px;
}

.input-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.input-row .input-group {
    flex: 1;
    min-width: 200px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 1rem;
}

label i {
    color: #667eea;
    margin-left: 8px;
    font-size: 1.1em;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.doors-windows-section {
    background-color: #f8f9ff;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border: 1px solid #e1e5ff;
}

.material-selection {
    margin: 30px 0;
}

.radio-group {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.radio-item label {
    margin-bottom: 0;
    cursor: pointer;
    font-size: 1.1rem;
}

.radio-item label i {
    color: #667eea;
    margin-left: 8px;
    font-size: 1.2em;
}

.combo-section {
    margin: 20px 0;
}

.combo-group {
    margin-bottom: 20px;
}

.add-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.add-btn i {
    margin-left: 8px;
    font-size: 1.1em;
}

.clear-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
    margin-right: 15px;
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
    background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
}

.clear-btn:active {
    transform: translateY(0);
}

.clear-btn i {
    margin-left: 8px;
    font-size: 1.1em;
}

.button-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.add-btn:active {
    transform: translateY(0);
}

.results-section {
    padding: 30px;
}

.data-view {
    margin-bottom: 30px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

th i {
    margin-left: 5px;
    font-size: 0.9em;
}

td {
    padding: 12px 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

tbody tr:hover {
    background-color: #f8f9ff;
}

tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.totals-section {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: space-around;
    margin-top: 30px;
}

.total-group {
    flex: 1;
    min-width: 250px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8eaff 100%);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e1e5ff;
}

.total-group label {
    color: #555;
    font-weight: 700;
    margin-bottom: 10px;
}

.total-group label i {
    color: #667eea;
    margin-left: 8px;
    font-size: 1.2em;
}

.total-group input {
    background-color: white;
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
    text-align: center;
}

/* تخفي عناصر الأبواب والشبابيك عند اختيار السقف */
.ceiling-selected .doors-windows-section {
    display: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        max-width: 95%;
        margin: 10px auto;
    }
    
    .input-row {
        gap: 15px;
    }
    
    .input-row .input-group {
        min-width: 180px;
    }
}

/* Tablet Design (iPad) */
@media (max-width: 1024px) {
    .container {
        margin: 15px;
        border-radius: 12px;
    }
    
    h1 {
        font-size: 2.2em;
        padding: 25px;
    }
    
    .form-section,
    .results-section {
        padding: 25px;
    }
    
    .input-row {
        gap: 15px;
    }
    
    .input-row .input-group {
        min-width: 150px;
    }
    
    .telegram-link {
        padding: 0 25px 18px 25px;
        gap: 12px;
    }
    
    .telegram-btn,
    .tiktok-btn {
        padding: 12px 22px;
        font-size: 0.95rem;
    }
    
    .radio-group {
        gap: 25px;
    }
    
    .totals-section {
        gap: 15px;
    }
    
    .total-group {
        min-width: 200px;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    th,
    td {
        padding: 10px 8px;
    }
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 10px;
    }
    
    h1 {
        font-size: 2em;
        padding: 20px;
    }
    
    .site-description {
        padding: 8px 20px 12px 20px;
    }
    
    .site-description p {
        font-size: 0.95rem;
        padding: 0 10px;
    }
    
    .telegram-link {
        padding: 0 20px 15px 20px;
        gap: 10px;
    }
    
    .form-section,
    .results-section {
        padding: 20px;
    }
    
    .input-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .input-row .input-group {
        min-width: auto;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .totals-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .total-group {
        min-width: auto;
    }
    
    .telegram-btn,
    .tiktok-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .telegram-link {
        flex-direction: column;
        gap: 10px;
    }
    
    table {
        font-size: 0.75rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    th,
    td {
        padding: 8px 5px;
        min-width: 80px;
    }
    
    .add-btn {
        width: 100%;
        padding: 12px;
        font-size: 1.1rem;
    }
    
    .clear-btn {
        width: 100%;
        padding: 12px;
        font-size: 1.1rem;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .button-group {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        margin: 5px;
        border-radius: 8px;
    }
    
    h1 {
        font-size: 1.6em;
        padding: 15px;
    }
    
    .site-description {
        padding: 5px 15px 10px 15px;
    }
    
    .site-description p {
        font-size: 0.9rem;
        padding: 0 5px;
    }
    
    .telegram-link {
        padding: 0 15px 12px 15px;
        gap: 8px;
    }
    
    .form-section,
    .results-section {
        padding: 15px;
    }
    
    .doors-windows-section {
        padding: 15px;
        margin: 15px 0;
    }
    
    .telegram-btn,
    .tiktok-btn {
        padding: 10px 18px;
        font-size: 0.85rem;
        width: 100%;
        text-align: center;
    }
    
    h2 {
        font-size: 1.3em;
    }
    
    h3 {
        font-size: 1.1em;
    }
    
    label {
        font-size: 0.9rem;
    }
    
    input[type="text"],
    input[type="number"],
    select {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .add-btn {
        padding: 12px;
        font-size: 1rem;
    }
    
    .clear-btn {
        padding: 12px;
        font-size: 1rem;
        margin-right: 0;
    }
    
    table {
        font-size: 0.65rem;
    }
    
    th,
    td {
        padding: 6px 3px;
        min-width: 70px;
    }
    
    .total-group {
        padding: 15px;
    }
    
    .total-group label {
        font-size: 0.85rem;
    }
    
    .total-group input {
        font-size: 0.9rem;
    }
}